MMaxTools

Regex Tester

Test regular expressions live with matches, positions and capture groups.

The Regex Tester lets you build and debug JavaScript regular expressions against real text, live. Type a pattern, toggle flags, and every match appears with its position and capture groups — no console, no setup, instant feedback.

Regular expressions are powerful and notoriously easy to get subtly wrong: a pattern that matches too much, too little, or hangs on certain inputs. Seeing exactly what matched, where, and which groups were captured turns trial-and-error into deliberate construction. The tool reports errors with the same messages your engine would throw, and flags can be toggled individually (g for all matches, i for case-insensitive, m for multiline, s for dot-all, u for unicode).

This tester uses the JavaScript (ECMAScript) regex engine — the same flavor as browsers and Node.js. Regex syntax differs across languages, so patterns written here may need adjustment for PCRE (PHP, Perl) or other engines. Everything runs locally in your browser.

Flags

5 matches

#1 @ 4: "quick"
#2 @ 10: "brown"
#3 @ 20: "jumps"
#4 @ 26: "over"
#5 @ 35: "lazy"

JavaScript (ECMAScript) flavor. Check "g" to find all matches, "i" for case-insensitive, "m" for multiline, "s" for dot-all, "u" for unicode.

How to use the Regex Tester

  1. Type your pattern (leave the slashes off — flags have their own buttons).
  2. Toggle the flags you need — 'g' to list every match.
  3. Type or paste the text to search.
  4. Read each match with its start index and capture groups.
  5. Fix pattern errors using the message shown under the pattern field.

Frequently asked questions

Which regex flavor does this use?

JavaScript (ECMAScript) — the engine inside browsers and Node.js. If your target is PHP, Python, or grep, the core syntax is similar but features differ (lookbehind support, \d semantics, named groups), so test in your target environment too.

Why does my pattern only show one match?

Without the 'g' (global) flag, regex engines stop at the first match. Toggle 'g' to list every match with its index — the flag buttons make the difference visible immediately.

How do I see capture groups?

Wrap parts of your pattern in parentheses — (\d+)-(\.\w+) — and each match lists its groups as $1, $2… beneath it. Non-capturing groups (?:…) let you group without creating captures.