Capturing

Learn how to group and capture different portions of the match.

Regular expressions allow us to group and capture portions of the match for later use. To extract an American telephone number of the form (202) 456-1111 from a string, use this:

Get hands-on with 1400+ tech skills courses.