Regex Tester — Guide

Test regular expressions online with live match results — JavaScript flavor, toggle flags and capture groups instantly.

What it is and when to use it

Regular expressions fail silently: a pattern that looks right may be matching the wrong thing. A live tester closes the gap between writing a pattern and trusting it — paste the real text you need to parse, and every match, capture group and flag effect is highlighted as you type.

Tests regular expression matches live, so you can verify as you write.

How to use it

  1. Write the pattern in the top field (without the surrounding slashes)
  2. Enter the text to match in the bottom field
  3. Review the highlighted matches and capture groups

A worked example

Fill in a sample pattern

\d{3}-\d{4}

Copy this into the tool, or open Regex Tester

Things that trip people up

  • Add the g flag for global matching, otherwise only the first match is reported

Questions people ask

Which regex flavor does this use?
JavaScript (ECMAScript). Everyday syntax is shared with PCRE and Python, but lookbehind, named groups and unicode handling differ between engines — keep the rules of your target language in mind when testing.
What do the flags mean?
g returns all matches instead of stopping at the first one; i ignores case; m makes ^ and $ match line boundaries; s lets the dot match newlines.
Is my text sent anywhere?
No. Matching runs entirely in your browser — nothing you paste ever leaves the page.
How do I test a regex with capture groups?
Write the groups into your pattern (e.g. (\d+)-(\d+)), run it against your text, and each match lists its capture groups with their values — so you can verify not only that the pattern matches, but that the right parts land in the right groups.
Why does my regex work here but fail in my program?
Usually a flavor or escaping difference: languages disagree on lookbehind, named groups and unicode classes, and string literals often eat a backslash before the regex engine sees it. Test with the same escaping your program uses.

Next steps

Open the Regex Tester tool

Spotted something wrong on this page? Tell us via Contact Us