WW Tools
All references

Regex Flags Reference

JavaScript regular expressions accept single-letter flags after the closing slash (for example /pattern/gi). Each flag changes how the pattern matches. This is the full set supported by modern engines.

FlagNameEffect
gglobalFind all matches, not just the first.
iignoreCaseCase-insensitive matching.
mmultiline^ and $ match at line breaks, not just string start/end.
sdotAllThe dot (.) also matches newline characters.
uunicodeTreat the pattern as a sequence of Unicode code points.
ystickyMatch only from lastIndex; no scanning ahead.
dhasIndicesRecord start/end positions of each captured group.
vunicodeSetsUpgraded Unicode mode with set notation and string properties.

Frequently asked questions

Can I combine multiple regex flags?

Yes. Append them in any order after the closing slash, for example /foo/gims. Each flag is independent.

What is the difference between the u and v flags?

Both enable Unicode mode. The v flag (unicodeSets) is a superset that adds set operations and properties of strings. You cannot use u and v at the same time.

Use the tool