How it works
The pattern and flags are compiled into a real JavaScript RegExp and run
against your test text. Every match is highlighted in place, using the
same matching engine your code will actually run against.
Common flags
g finds every match instead of stopping at the first (applied
automatically here), i ignores case, m makes ^ and $ match the
start and end of each line rather than the whole string, and s lets .
match newlines too.
Debugging a pattern that matches too much or too little
Watch which parts of the text get highlighted as you adjust the pattern. A pattern that is too greedy usually shows up as matches spanning further than expected; one that is too narrow shows up as expected text left unhighlighted.