Sign in Start free

15Flags i m s g

Flags change how the whole pattern behaves: case, lines, dot and global search.

Flags (also called modifiers) are switches for the whole pattern. In JavaScript they follow the closing slash: /hello/gi. In the tester, click the flags button next to the pattern.

gglobal – find all matches, not just the first
iinsensitive – ignore upper/lower case
mmulti line – ^ and $ match at every line
ssingle line – . also matches line breaks
uunicode – full Unicode, \p{…} properties

In these exercises, type the flags in the small box next to the pattern.

Exercises