Live · visual · private

Regex Tester Online

Test JavaScript regular expressions online for free and see every match, capture group and replacement update as you type.

//
Pattern valid
Test text2 matches

🔒 Everything runs locally. Your pattern and text never leave this browser.

How to test regex online

  1. Enter your pattern without surrounding slashes.
  2. Choose flags such as g, i or m.
  3. Paste test text and inspect highlighted matches.
  4. Open match details to verify capture groups.

JavaScript regex cheat sheet

\d digit · \w word character · . any character · + one or more · * zero or more · ? optional · ^ start · $ end · ( ) capture group.

This online regex tester uses your browser’s JavaScript regex engine, so supported features depend on your browser.

Regex tester online FAQ

Quick answers about the JavaScript regex engine, flags, capture groups and privacy.

Which regex flavor does this tester use?

It uses the JavaScript regular expression engine built into your browser.

How do I test a regex online?

Enter a pattern without surrounding slashes, select any flags, paste test text and inspect the highlighted matches and capture groups.

Which JavaScript regex flags can I use?

You can type any flag supported by your browser, including g, i, m, s, u, y and d where available.

Can I test regex replacement text?

Yes. Enter replacement text to preview numbered groups such as $1, named groups such as $<name>, or the full match with $&.

Is my test text uploaded?

No. Your pattern, test text and replacement stay in your browser.

Try other useful tools

Keep working with data and developer-friendly text utilities.

See all tools →