How this tester runs your pattern
The pattern is compiled by the JavaScript engine of your browser and run against the test text in a Web Worker. Matches are highlighted and listed with their position and capture groups. If the worker has not answered after 2 seconds it is terminated and you are told so.
Catastrophic backtracking
The "Slow pattern" button loads this:
pattern ^(a+)+$
text aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!The text almost matches, then fails at !. Before giving up, the engine tries every way of dividing the run of a between the inner and the outer +, which doubles with each extra character. On a server, a pattern like this applied to user input is a denial-of-service hole (ReDoS). The fix is to make the pattern unambiguous: ^a+$ matches the same strings in linear time.
Flags
gfinds every match instead of the first.iignores case.mmakes^and$match at line breaks.slets.match a line break.utreats the text as code points (needed for\p{L}and for emoji).ymatches only at the current position.
Patterns for PCRE, Python, Go or Java can differ in syntax. For those flavours, and for a step-by-step debugger, use regex101.