Regex Tester

Test JavaScript regular expressions, captures and replacements locally in a time-limited worker.

About this tool

Test JavaScript regular expressions and replacement strings locally. See each match’s UTF-16 start/end offsets, capture groups and named groups, then download the replacement output.

Use this tool step by step

  1. Paste a JavaScript regular expression and a small representative text sample, then choose the flags you need. Keep private text in this local tab.
  2. Inspect matches and capture groups before trying a replacement. Test both matching and non-matching examples; the worker time limit protects this page but is not a performance guarantee for your application.

How it works

The selected flags create a JavaScript RegExp. Matches advance after zero-length results to avoid a loop. Replacement uses JavaScript substitution tokens. Both operations run in a dedicated worker. Its script has up to 15 seconds to load; the separate one-second execution deadline starts only after the worker is ready. A running worker is terminated if that deadline is exceeded.

Example workflow

Pattern (?<word>[A-Za-z]+) with g against Hello world produces two named-word matches. Replacement $<word>! produces Hello! world!.

Assumptions and limitations

This is the JavaScript flavour, not PCRE, Python or every other regex dialect. Display is capped at 1,000 matches, pasted input at 262,144 characters and replacement output at 1 MiB. A timeout is a rejected operation, not a no-match result.

Start with a small test and prefer unambiguous quantifiers. Use g to replace all matches; without g, replacement affects the first match. No visitor pattern is evaluated as JavaScript code and no text is uploaded.

Sources and editorial responsibility

Maintained by Renvoro Pty Ltd. Sources inform the methods and assumptions shown here; outputs have the limitations described on this page.

Guide updated 2026-11-17. Calculation method and source dates remain separate.

Method reviewed 2026-10-23. Calculation standards · Report an issue