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 JavaScript!
You have completed Regular Expressions in JavaScript!
Preview
Flags let you change what a regular expression matches in some way. Learn about the most common flags.
This video doesn't have any notes.
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
There are a number of flags,
but we'll focus on three.
0:00
Each one of these flags overrides
a default behavior of regular expressions.
0:00
First, i stands for case-insensitive.
0:05
Using i will make the parser disregard
case when searching for matches.
0:09
G is for global.
0:14
By default, the regular expression will
stop searching once it finds a match.
0:15
The g flag tells the parser to find
all matches contained in a string.
0:20
The m flag stands for multiline.
0:25
Normally a caret will only match
the very beginning of a string and
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