Regex Tester

Test your regular expressions with sample text.

About Regex Tester

Test a regular expression against sample text and see every match highlighted, with its position and capture groups. It uses the JavaScript regular-expression engine of your browser.

When you would use it

How to use it

  1. Type the pattern (without the surrounding slashes) in the regex field.
  2. Tick the flags you need: global, ignore case, multiline, dot-all, unicode or unicode sets.
  3. Enter or paste the text to match; the matches and their groups are listed below.

Things worth knowing

Frequently asked questions

Why does my pattern work here but not in another language?
Regex engines differ. Lookbehind, named groups, flags and Unicode handling vary between JavaScript, Python, PCRE, Java and others. Test with the engine your code actually runs on.
Why do I only see one match?
The global (g) flag is off. Turn it on to find all matches instead of stopping at the first one.

All the tools