Use Modifiers to simplify the usage of Regular Expressions with JavaScript. It helps you to search in multiple lines, perform a case-insensitive search, etc.
Example
The following are the methods −
Sr.No | Modifier & Description |
---|---|
1 | I Perform case-insensitive matching. |
2 | M Specifies that if the string has newline or carriage return characters, the ^ and $ operators will now match against a newline boundary, instead of a string boundary |
3 | G Performs a global match that is, find all matches rather than stopping after the first match. |