Developer Tools

Regex Tester

Test JavaScript regular expressions against sample text in your browser.

Test a JavaScript regular expression against sample text — see matches, capture groups, and match positions — entirely in your browser, using your browser's native RegExp engine. Need to actually replace matched text? Try Find & Replace.

Your pattern and test text stay in your browser. Matching uses your browser's native JavaScript RegExp engine.
Flags

How it works

Private regex testing in your browser

1

Enter a pattern and flags

Type the raw regex pattern and choose flags like g (global) or i (ignore case).

2

Add test text

Paste or type the text you want to check the pattern against.

3

Test and review matches

See match count, matched text, positions, and capture groups.

Use cases

When this comes in handy

Debug a pattern

Check why a regular expression isn't matching the text you expect.

Validate input formats

Test a pattern for emails, IDs, or codes against a handful of real examples.

Extract structured data

Check capture groups pull out the right pieces of matched text.

FAQ

Common questions

Is my pattern or text uploaded anywhere?

No. Matching runs entirely in your browser using the native JavaScript RegExp engine.

Do I need to include slashes, like /pattern/g?

No. Enter just the raw pattern, like \bhello\b, and choose flags separately using the checkboxes.

Why does it only show one match?

The g (global) flag is off. Turn it on to find every match instead of just the first.

Does this support every regex flavor?

It uses your browser's native JavaScript RegExp engine, so it follows JavaScript regex syntax and semantics rather than PCRE, Python, or other flavors.

What happens with an invalid pattern?

You'll see a clear error message instead of a crash. Fix the pattern and test again.

Related Tools