🚩regex flag

🚧 under construction

JSvalueobjectregex ⟩ flag

/abc/igd	     // ignnore case, global search, generate indices
flagdescriptioncorresponding property

generate indices for substring matches.

treat a pattern as a sequence of Unicode code points.

g

global search.

i

ignore case.

m

allows ^ and $ to match newline.

s

allows . to match newline.

y

"sticky" search: matches starting at the current position in the target string.

when using str.matchAll(regex), the regex must have the global (g) flag set, or a TypeError is thrown

Last updated