Skip to main content

Regex Tester

Test your pattern

See matches and replacements as you type.

Your text stays in your browser.

Expression

Flags

Uses your browser’s JavaScript regex engine.

Test text

Matches

0 found
Try AB-1234 or CD-5678

Replace

Test JavaScript regular expressions, inspect matches, and preview replacements in your browser.

Redact order codes and check the near misses

Paste the pattern and test text below. Turn on g and turn off i. With [code] as the replacement, the preview should read [code], [code], xy-9999. Turn i on and the lowercase code is replaced too. Turn g off and only the first code is replaced, even if the match list still shows others.

Pattern

\b[A-Z]{2}-\d{4}\b

Test text

AB-1234, CD-5678, xy-9999

What a passing test tells you

This runs JavaScript regular expressions in your browser. Retest in the destination engine if you are writing a rule for Python, grep, or a database. The list shows up to 1,000 matches and slow patterns time out. If a pattern stalls, test a short sample with a near miss and simplify nested repetitions.

Frequently Asked Questions

Is my text uploaded?

No. Testing happens locally in your browser.

Which regex syntax is supported?

This tool uses your browser’s JavaScript regular expression engine and its supported flags.