About Regex Tester

Real-time regex testing environment with a pattern input, configurable flags (g, i, m, s, u, y), a multi-line test string, and live in-place match highlighting. Each match shows its position, numbered capture groups, and named capture groups ((?<name>…)). A Replace panel previews a substitution against the test string, supporting $1 (numbered), $<name> (named), and $& (whole match) backreferences, respecting the active flags (so the g flag controls replace-all). Includes seven preloaded patterns (email, US phone, URL, ISO date, IPv4, hex color, HTML tag) and a quick reference for character classes, quantifiers, and anchors.

  • Six regex flags with checkboxes: global, ignore case, multiline, dotAll, unicode, sticky
  • Real-time validation—invalid patterns show the exact JavaScript RegExp error message
  • Match highlighting injects <mark> tags into the test string with offset tracking (XSS-safe escaping)
  • Match details show each match string, index position, numbered groups, and named groups
  • Replace panel previews substitutions with $1, $<name>, and $& backreferences, honoring the g flag
  • Copy pattern in /pattern/flags notation, copy all match values, or copy the replace result

Frequently Asked Questions

How is this different from the Regex Pattern Explainer?
The Explainer breaks down what each part of a pattern means. The Tester is for running patterns against actual text to see what matches. Use the Explainer when you are reading someone else’s regex; use the Tester when you are writing and debugging your own.
Why does my pattern work here but fail in my Python/Go/Java code?
This tester uses JavaScript’s RegExp engine, which has differences from PCRE (Python/PHP), RE2 (Go), or java.util.regex. Common incompatibilities include lookbehinds (limited in JS), possessive quantifiers (not supported in JS), and Unicode property escapes (requires the u flag in JS).

More Development Tools

All Development tools