RegExp Flags

suggest change

There are several flags you can specify to alter the RegEx behaviour. Flags may be appended to the end of a regex literal, such as specifying gi in /test/gi, or they may be specified as the second argument to the RegExp constructor, as in new RegExp('test', 'gi').

g - Global. Finds all matches instead of stopping after the first.

i - Ignore case. /[a-z]/i is equivalent to /[a-zA-Z]/.

m - Multiline. ^ and $ match the beginning and end of each line respectively treating \n and \r as delimiters instead of simply the beginning and end of the entire string.

u - Unicode. If this flag is not supported you must match specific Unicode characters with \uXXXX where XXXX is the character’s value in hexadecimal.

y - Finds all consecutive/adjacent matches.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Regular Expression:
* Syntax
* RegExp Flags

Table Of Contents
11 Arrays
12 Objects
14 Classes
16 Map
17 Set
24 Loops
27 Date
29 Scope
30 AJAX
32 Regular Expression
35 Cookies
41 JSON
44 Fetch
45 Modules
46 Screen
64 Console
68 Symbols
73 Modals
76 Events
86 Proxy
89 WeakMap
90 WeakSet
102 Tilde