Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Introduction to Regular Expressions!
You have completed Introduction to Regular Expressions!
Preview
Learn match ranges of characters such as a-z, A-Z or 0-9.
Practice
Copy each set of test strings into regex101. Using what you've learned so far, create a regular expression that will match all of the strings in the set.
1 )
bat
cat
data
eat
fast
2 )
1 a
2 a
3 a
4 a
5 a
8 a
9 b
3 )
8345 Gable
7238 Gable
2349 Table
8475 Cable
0994 Fable
1047 Zable
4 )
4849
4472
4901
40502
43470
40496
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
a range of numbers,
like 0 through 9, in character sets.
0:00
Let's say, instead of the first set that
matches just these three characters,
0:01
you want to match any
letter in the alphabet.
0:06
This can be done by replacing
the contents of the brackets.
0:09
We'll set A-Z.
0:16
This hyphen tells the parser to include
all letters in the range from A to Z.
0:20
You can see below that only one
of the strings is highlighted.
0:27
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