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
Matching any character EXCEPT a specific character can be very useful at times. Learn how.
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:
foxes
jumping
dogs
Exclude:
aaaaa
2 )
Match:
34522
72379
Exclude:
1234k
5784k
5784k
3 )
Match *only* the commas:
pears,
apples,
cherries,
oranges,
4 )
Match only the text character strings from each line ('html', 'head', etc):
<html>
<head>
</head>
<body>
<div>
</div>
</body>
</html>
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