Understand the six flags that change how a regex behaves, with examples.
Flags are switches attached after a regex that change its overall behavior. JavaScript has six of them. g (global) does not stop at the first match but finds every match. Without this flag, only the first one is caught.
i (ignoreCase) makes matching case-insensitive. m (multiline) changes ^ and $ so they match the start and end of each line rather than of the whole string. It is essential when working with multi-line text.
s (dotAll) makes the dot (.) include line-break characters as well. u (unicode) correctly interprets Unicode code points and \p{...} property escapes. y (sticky) only allows a match that begins exactly at the lastIndex position.
Toggle the flag chips in this tester on and off to compare how the same pattern changes. In particular, seeing with your own eyes how the number of results changes depending on whether g is present builds intuition quickly.