Write a pattern, paste sample text, and watch matches highlight as you type. Syntax errors are reported with the position. Uses the same engine your script will.
It compiles your pattern with new RegExp and runs it against the sample text, wrapping every hit in a highlight. Compilation failures are caught and shown rather than thrown, so you can see the exact offset of a missing bracket instead of guessing.
Zero-length matches are handled — the engine advances one position after each so patterns like \b or (?=x) cannot spin forever.
g global — keep going after the first match. Forced on for highlighting.i ignore case — a matches A.m multiline — ^ and $ match at every line break, not just at the ends of the whole string.s dotAll — . also matches a newline.u unicode — treat the pattern as code points, which is required for \p{...} classes and astral characters.Nested quantifiers are the usual culprit: (a+)+b against a long run of a with no b at the end tries an exponential number of ways to split the run. The browser will sit there. Anchoring with ^, using a lazy quantifier, or replacing the inner + with an atomic-ish shape usually collapses it back to linear.
The other frequent mistake is forgetting to escape. . matches any character; \. matches a literal dot. Same for (, ), [, ], {, }, +, *, ?, |, ^ and $.
JavaScript, via the browser's own RegExp engine.
Finds every match instead of stopping at the first.
Almost always catastrophic backtracking from a nested quantifier. Anchor it or make it lazy.
No. Everything runs locally.