HomeToolsRegex Tester

Regex Tester

Test and debug regular expressions in real time with match highlighting, capture groups, replace mode, and a library of common patterns.

Real-time matchingCapture groupsFlag toggles (g, i, m, s, u)Match highlightingReplace modeCommon patterns library
//g
Flags:
0
Matches
0
Capture Groups
1
Active Flags

How to Use the Regex Tester

  1. 1Enter your regular expression pattern in the pattern input field
  2. 2Toggle flags (g, i, m, s, u) to control matching behavior
  3. 3Paste or type your test string in the textarea below
  4. 4View real-time match highlighting and detailed match results with capture groups
  5. 5Enable Replace Mode to test pattern replacements using $1, $2, etc.
  6. 6Use the Common Patterns button to quickly load patterns for emails, URLs, IPs, and more

Frequently Asked Questions

What regex flags are available and what do they do?

The tool supports five flags: g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line boundaries), s (dotAll — . matches newlines), and u (unicode — enables full Unicode matching). Toggle them on or off to control how your pattern matches.

How does the replace mode work?

Enable Replace Mode to enter a replacement string. You can use capture group references like $1, $2, etc. to insert matched groups into the replacement. The result updates in real time as you type the pattern, test string, or replacement.

Is my data sent to a server?

No. The regex tester runs entirely in your browser using JavaScript's built-in RegExp engine. Your patterns and test strings never leave your device, ensuring complete privacy.

Why is my regex showing an error?

The tool validates your pattern in real time and displays the browser's native error message. Common issues include unescaped special characters (like . or *), unmatched parentheses or brackets, and invalid flag combinations. Check the error message for specifics.

Can I test regex with capture groups?

Yes! The match details panel shows every capture group for each match. Named groups and numbered groups are both supported. Use parentheses in your pattern to create capture groups, and they'll appear in the results automatically.

Need More Developer Tools?

Explore our complete collection of free online developer utilities

View All Tools