Don's Tools · Developers · Regex Tester

Regex tester

Test regular expressions with live highlighting and groups, right in your browser. Nothing is uploaded.

//
Replace with
Good to know: Matches are highlighted live; add a replacement to preview the result.
Quick regex cheatsheet
. any char · \d digit · \w word · \s space · ^ start · $ end · * 0+ · + 1+ · ? 0-1 · {n,m} range · [abc] set · (x|y) or · (..) group · \b word boundary
Regex Tester is a free developer tool that tests JavaScript regular expressions entirely in your browser, with nothing uploaded. It highlights every match live, lists capture groups for each match, supports the global, ignore-case, multiline and dotall flags, previews replacements using captured groups, and reports clear errors for invalid patterns.

Files are processed in your browser and never uploaded.

How to use Regex tester

  1. Add your text

    Type or paste your text into the input box. Everything is handled by your own browser, so nothing is sent to a server.

  2. Set the options

    Choose pattern and Replace with. The options are visible from the start, not hidden until you paste something.

  3. Read it and keep a copy

    The output updates as you type, so there is nothing to submit and nothing to wait for. Copy result, Don puts the result on your clipboard.

What this tool does

Live match highlighting

Matches are highlighted in the test string as you type, so a pattern can be corrected against real text rather than in the dark.

Capture groups listed per match

Every match lists its capture groups, which is usually where a pattern turns out to be matching more than you meant.

g, i, m, s flags

The g, i, m and s flags are all available, so global, case-insensitive, multiline and dotall behaviour can each be tested.

Replacement preview

Enter a replacement and the result is previewed, group references included, before you use the pattern anywhere real.

Works offline, no sign-up

The pattern and the text stay in your browser, and the built-in cheatsheet saves a trip to a reference page.

Frequently asked questions

Is my text uploaded anywhere?

No. Patterns and text are processed entirely in your browser with the standard JavaScript regular-expression engine, so nothing is uploaded. It works offline once loaded.

Which regex flavour is this?

JavaScript regular expressions, the same ones used in web browsers and Node. The g, i, m and s flags are available as checkboxes.

How do I see capture groups?

Each match in the list shows its capture groups numbered from dollar-one onward, so you can confirm a pattern captures what you expect.

Can I preview a replacement?

Yes. Type a replacement in the box, using dollar-one, dollar-two and so on for captured groups, and copy the replaced text.

Why does my pattern show invalid?

If the pattern has a syntax error, such as an unclosed group or bracket, the exact engine message is shown so you can fix it.

Last updated: