Developer Tools

Regex Tester

Test JavaScript regular expressions locally. Highlight matches, inspect numbered and named capture groups, and export a match report without uploading your text.

Your content stays on your device Free, with no account
Find the pattern. See every match. Local worker · 3-second limit
Pattern only, without / delimiters. Up to 2,000 UTF-16 units.
Up to 100,000 UTF-16 units. Browser textarea line endings normalize to LF.
YOUR MATCHES

Ready. Enter a pattern and test text.

Positions use UTF-16 units: index starts at 0, end is exclusive, line/column start at 1. Unmatched captures are null; empty captures are "". Up to 500 matches are shown. Reports contain matched text—review before sharing.

Pattern quick reference

\d digit · \w word character · \s whitespace · + one or more · * zero or more · ^/$ anchors · (…) numbered capture · (?<name>…) named capture.

This uses your browser’s JavaScript RegExp engine, not PCRE or Python syntax. The g flag finds successive non-overlapping matches. Expressions run only after you select Test expression. Complex patterns can time out; no partial report is exported on errors.

JavaScript match and capture reference ↗
A FEW SIMPLE STEPS

How to use Regex Tester

  1. Enter a JavaScript regular expression without surrounding / delimiters, or select Try an example.
  2. Choose flags, paste your test text and select Test expression. Turn off Match all to inspect only the first match.
  3. Review highlighted whole matches and the JSON report with positions and capture groups. Cancel or edit a field to stop pending work.
  4. Copy or download the report. A limit notice means only the first 500 matches were recorded; it is not a total count.
PRIVATE BY DESIGN

Why use this tool?

Your patterns and test text stay on your device. Testing happens in a disposable browser worker with no uploads, saved input history or account. Match highlights are safe text nodes, never rendered HTML. Cancel, edits and page exit terminate pending work.

Tool inputs stay in your browser. Only your theme preference is saved on this device.

A few things worth knowing

Which regular expression language is supported?

This tool uses the JavaScript RegExp engine built into your browser. It supports the g, i, m, s and u flags. Syntax availability depends on your browser. PCRE, Python, Java and other engines may behave differently. Enter pattern text directly, without / delimiters; backslashes do not need JavaScript string escaping.

What do the flags do?

g finds successive non-overlapping matches; without it only the first match is returned. i ignores case, m changes line-anchor behavior, s lets dot match line terminators, and u enables Unicode-aware matching. Sticky matching, Unicode sets and capture index flags are not exposed in this version.

How are capture groups and positions reported?

Each match reports its value, zero-based start index and exclusive end, and one-based line and column. All positions use UTF-16 units, so emoji can take two units. Browser textarea line endings normalize to LF; line counting also recognizes Unicode line and paragraph separators. Numbered captures appear in order, named captures under groups. An unmatched capture is null while a matched empty string is "". Capture values, not separate capture positions, are reported.

What about empty matches, no matches or too many matches?

Zero-length matches appear as vertical markers in the preview. Global matching advances one Unicode code point with u, otherwise one UTF-16 unit, after an empty match. No matches produces an empty matches array, which can still be exported. Results show at most 500 matches. If another match exists, limited is true and the total is not calculated. Capture data is bounded to 400,000 compact JSON units; larger reports fail without partial exports.

Can a complex pattern freeze the website?

Expressions run in a worker rather than on the page thread. A three-second deadline includes worker startup; Cancel, edits or page exit terminate the worker. Errors and timeouts clear prior results and expose no partial output. Input is limited to 100,000 UTF-16 text units and 2,000 pattern units.

Is my text uploaded or included in the download?

Nothing is uploaded or stored by this tool. The JSON report contains the pattern, flags, matched text and captures, so it may contain sensitive portions of your input. Review before sharing it. Unmatched source text is not included in the report, though it remains visible in the local highlighted preview. Text and markup are never executed.