Free Regex Tester

Test JavaScript regular expressions with highlighted matches, capture groups and a replace preview.

Runs in your browser. Nothing you type is uploaded.

How to use the Regex Tester

  1. Type your pattern and turn on the flags you need.

  2. Paste the text you want to test against.

  3. Read the matches and groups, and add a replacement to preview it.

Questions

Which regex flavour does this use?

It uses the JavaScript engine in your browser, so results match what RegExp does in your code. Some features from other languages, such as possessive quantifiers, are not available.

Why did I get a message that the pattern took too long?

Patterns with nested repetition, such as (a+)+, can take exponential time on some inputs. The tester runs in a background worker and stops after one second so your tab does not freeze.

Why does the list show every match when the g flag is off?

The list always finds every match so you can see them all. The g flag still controls the replace preview, which replaces only the first match without it.

More developers tools

View all tools