About this tool
This tester uses the browser’s JavaScript RegExp engine. Matching and replacement run in a disposable worker with a 500 ms deadline, while explanations come from the regexpp syntax tree rather than generated guesses.
How to use it
- Enter a JavaScript pattern and supported browser flags.
- Add test text and optional JavaScript replacement syntax.
- Inspect match indices, capture groups, highlighted boundaries, output, and the parsed explanation.
Flags and matches
- Without g, JavaScript returns and replaces only the first match. With g, all matches are processed up to the 1,000-item display cap.
- The u and v Unicode modes describe different grammars and are mutually exclusive. Support for v depends on the browser engine.
Zero-width matches and safety
- Zero-width matches have identical start and end indices, so they appear in match details without manufacturing highlighted text.
- A timeout reduces the risk from hostile backtracking, but it cannot prove a pattern is efficient for every input.
Frequently asked questions
Does this use PCRE syntax?
No. It supports JavaScript regular expressions only, using the flags and replacement behavior implemented by your browser.
Can a regex still be dangerous?
Yes. Backtracking cost depends on both pattern and input. Work is terminated after 500 ms, but production code should still constrain input and review complex expressions.