Skip to main content
AltF Calculators

Regex Tester

  • 100% private — nothing is uploaded
  • Instant, live results as you type
  • Free forever, no sign-up needed
  • Works even when you're offline

About Regex Tester

The regex tester lets you build and try a regular expression against sample text and see every match instantly. It uses the JavaScript regular-expression engine, so what you see here matches how the pattern behaves in JavaScript code.

For each match it shows the matched text, its position in the string, and any captured groups — making it easy to develop and debug patterns for search, validation and extraction.

How to use the Regex Tester

  1. Type your pattern (the body only, without the surrounding slashes).
  2. Toggle the flags you need: g (all matches), i (ignore case), m (multiline), s (dotall).
  3. Enter or paste the text to test against.
  4. Read the match count and the table of matches with their indices and groups.

Good to know

  • The g flag returns every match; without it the tester shows only the first match, mirroring JavaScript's exec/matchAll behaviour.
  • i makes matching case-insensitive, m makes ^ and $ match at line breaks, and s lets the dot (.) also match newline characters.
  • Parentheses create capture groups, shown per match; (?<name>…) creates a named group, displayed by its name.
  • This is the JavaScript (ECMAScript) flavour — some syntax from PCRE, Python or other engines may behave differently or be unsupported.

Frequently asked questions about the Regex Tester

Do I include the slashes around my pattern?

No. Enter only the pattern body, for example \d{3}-\d{4}. Choose the flags with the toggle buttons instead of writing them after a closing slash.

Why do I only see one match?

Turn on the g (global) flag. Without it, a regular expression matches just the first occurrence; with g the tester lists every match in the text.

What is the difference between the m and s flags?

m (multiline) changes ^ and $ to match at the start and end of each line, not just the whole string. s (dotall) makes the dot match newline characters too. They are independent.