Flags
This lesson will teach you about another component of regular expressions: flags.
We'll cover the following...
Let’s quickly look at this topic before closing the chapter. Flags are the last bit of dynamic behavior we can add to our regular expressions. We mentioned them before, but we want to cover the full list of options here so you can have a full reference to check in the future.
Flags with descriptions and examples
As we mentioned, flags essentially allow you to change the way the RegExp parser understands your expressions. Here are their effects:
Flag | Description | Example |
---|---|---|
g |
Global match: This is the most common and the one we’ve been using |