Test a regular expression against sample text as you type, with capture groups and flags broken out, so you can see what matched and why.
A regular expression that looks right and matches nothing usually differs from the intended one in a small way: a dot that matches any character rather than a literal full stop, a greedy quantifier swallowing past the intended end, or an anchor that means "start of string" when the input has several lines.
Matches are highlighted live in your sample text, with each capture group listed separately, so you can see which part of the pattern claimed which part of the input. This is JavaScript’s regex engine — the same one your code will run — so lookbehind, named groups and the u and s flags behave exactly as they will in production, including where they differ from PCRE.
Flags change the meaning of a pattern more than most of its characters do. Without m, the anchors ^ and $ match only the start and end of the whole string, so a pattern that works on one line silently matches nothing across several. Without s, a dot refuses to cross a newline. The g flag makes a regex stateful in JavaScript — it carries a lastIndex between calls, which is why reusing the same object in a loop produces results that skip every other match. Seeing the flags alongside the pattern is how those get caught before they reach code.
Catastrophic backtracking is the failure that takes a service down rather than returning a wrong answer. Nested quantifiers over overlapping alternatives — the classic shape is a repeated group that itself contains a repetition — can force the engine through an exponential number of paths on an input that merely fails to match. The symptom is a regex that is instant on short strings and hangs on a slightly longer one. If a pattern here becomes slow as you extend the sample, that is the reason, and the fix is usually to make the inner repetition unable to match the same text two ways.
JavaScript is not PCRE, and pattern copied from a Python or PHP answer can behave differently. Lookbehind exists in modern JavaScript but is not available everywhere older engines run; named groups use a different syntax from Python; possessive quantifiers and atomic groups do not exist at all; and the digit class matches only ASCII digits unless the u flag is set, while some other engines include other numeral systems by default. This page runs the browser own engine, so what you see here is what your code gets rather than an approximation of it.
A global regex keeps a lastIndex between calls. This tool resets it per run, so if you see no matches the pattern itself is not matching — try removing anchors first.
Yes. (?<name>...) works and the group is listed by name in the results.
Catastrophic backtracking on nested quantifiers can be very slow. Matching is guarded against runaway loops, but a pathological pattern such as (a+)+$ against a long string is worth avoiding.