Regex Tester

Live regex testing with match highlighting, capture groups, replace mode, and 12 common patterns.

//g

Common Patterns

Enter a regex pattern and test string above to see matches

About Regex Tester

Test and debug regular expressions in real time. Highlights matches, shows capture groups, supports all JS flags, includes 12 common patterns, and has a replace mode. Free online regex tester.

How to Use

  1. 1Enter your regex pattern in the pattern field (without slashes).
  2. 2Toggle the flags you need: g, i, m, s.
  3. 3Paste your test string — matches are highlighted in real time.
  4. 4Click a match card to focus it in the preview.
  5. 5Switch to Replace mode and enter a replacement string to see the replaced result.
  6. 6Use the Common Patterns buttons to quickly insert popular patterns like email or URL.

Frequently Asked Questions

Which regex flavour does this use?
JavaScript's built-in RegExp engine — the same one used in Node.js and all major browsers.
What flags are supported?
g (global), i (case insensitive), m (multiline), and s (dotAll — dot matches newlines).
Can I see capture groups?
Yes. Each match card shows numbered groups ($1, $2…) and named groups if your pattern uses (?<name>...).
What is Replace mode?
Switch to Replace mode, enter a replacement string (use $1, $2 for groups), and see the result of testString.replace(regex, replacement) instantly.