Regex Tester

Test and debug your regular expressions in real-time.

//g
Test String
0 Matches
Match Result
The quick brown fox jumps over the lazy dog. Contact: test@example.com or admin@site.org Phone: 123-456-7890

How do I test a regular expression online?

Type your pattern into the Regex Tester, choose flags such as g, i or m, and paste sample text. Every match is highlighted as you type, using the same JavaScript regex engine your code runs on.

Write and test JavaScript regular expressions against your own text, with every match highlighted as you type. Toggle flags such as global, case-insensitive and multiline, and use the built-in cheatsheet when you need a reminder of the syntax.

How to use the Regex Tester

  1. Enter a regular expression pattern.
  2. Choose the flags you need.
  3. Paste test text and watch the matches highlight.
  4. Adjust the pattern until it matches exactly what you want.

Frequently asked questions

Which regex flavour does it use?

The JavaScript engine in your browser, so results match what your JavaScript or TypeScript code will do.

What happens with a slow or runaway pattern?

Matching runs in a background worker with a time limit, so a catastrophic pattern stops instead of freezing the page.

How many matches are shown?

Up to 10,000 matches are highlighted. A notice appears if there are more.

How do I match a whole word?

Wrap the word in \b boundaries, for example \bcat\b matches cat but not category.

What does the g flag do?

The global flag finds every match in the text instead of stopping after the first one.