"How to Make a Video Game" was retired on August 1, 2018.
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 Regular Expressions in Python!
You have completed Regular Expressions in Python!
Now that we can search for just about anything, let's organize our results a bit better. Regular expressions give us indexed and named groups, both of which are super-handy.
New terms
-
([abc])- creates a group that contains a set for the letters 'a', 'b', and 'c'. This could be later accessed from theMatchobject as.group(1) -
(?P<name>[abc])- creates a named group that contains a set for the letters 'a', 'b', and 'c'. This could later be accessed from theMatchobject as.group('name'). -
.groups()- method to show all of the groups on aMatchobject. -
re.MULTILINEorre.M- flag to make a pattern regard lines in your text as the beginning or end of a string. -
^- specifies, in a pattern, the beginning of the string. -
$- specifies, in a pattern, the end of the string.
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