Regex Tester

Test and debug regular expressions in real time. See all matches highlighted, capture groups listed, and get instant match counts. Free, browser-based.

/ /

How to Use

  1. Enter your regular expression in the pattern field (without slashes).
  2. Paste or type the text you want to test in the Test String area.
  3. Toggle flags: g (all matches), i (case-insensitive), m (multiline), s (dotAll).
  4. Matches are highlighted in real time. Capture groups are listed below.

Common Regex Patterns

  • \d+ — one or more digits
  • \w+ — one or more word characters (letters, digits, underscore)
  • [a-zA-Z]+ — letters only
  • ^\s+|\s+$ — leading or trailing whitespace
  • (\w+)@(\w+\.\w+) — simple email capture
  • https?://\S+ — URLs

FAQ

Which regex flavor does this tool use?

JavaScript (ECMAScript) regex via the browser's built-in RegExp engine.

What flags are supported?

g (global), i (case-insensitive), m (multiline), and s (dotAll — dot matches newline). You can combine them.

Why does 'g' flag matter?

Without 'g', only the first match is returned. With 'g', all matches are found.

Are capture groups shown?

Yes. When matches have capture groups they are listed below each match.