Regex Tester

Test JavaScript regular expressions, inspect captures, and preview replacements without freezing your browser.

Opening your tool…

Processed on your device. Your files and inputs never leave your browser.

How it works

1

Enter a pattern and flags

2

Add your test string and optional replacement. Click Test expression.

3

Inspect highlighted matches and capture groups. A slow pattern is stopped automatically.

Patterns use JavaScript RegExp syntax without surrounding slashes. The g flag finds every match; without it, only the first match is shown. Named groups and replacement tokens such as $1, $&, and $<name> follow your browser's JavaScript support. Matching and replacement run in an isolated worker with a time budget. Match details are capped for readable output, and the interface explicitly reports truncation.

A few more useful tools

Good to know

Will a catastrophic pattern lock the page?

Processing happens in a worker. If a pattern exceeds the time budget, the worker is terminated and the page remains usable.

Does this use PCRE or Python regex syntax?

No. It uses your browser's JavaScript RegExp implementation. Features from other regex engines may differ or be unsupported.