Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Grouping characters allows you to apply modifications to multiple characters the way you have learned to do with single characters.
Practice
Copy both the Match and the Exclude set of test strings from each exercise below into a Regex tester like RegEx Pal or regex101. Using what you've learned so far, create a regular expression that will match all of the strings in the Match set and exclude the ones in the Exclude set.
1 )
Match:
img_01.jpg
img_02.png
img_03.gif
img_04.png
img_05.gif
img_06.jpg
Exclude:
mov_01.avi
2 )
Match:
projector
protractor
proctor
Exclude:
prospector
3 )
Match:
img_sm_01.jpg
img_01.jpg
img_sm_02.jpg
img_02.jpg
img_sm_03.jpg
img_03.jpg
img_sm_04.png
img_04.png
Exclude:
img.gif
4 )
Match:
www.github.com
github.com
www.teamtreehouse.com
teamtreehouse.com
api.github.com
Exclude:
jsfiddle.net
www.jsfiddle.net
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up