Regex Tester

Type a regex pattern and test string to instantly see highlighted matches, capture groups, and a replacement preview — all in your browser using JavaScript RegExp.

/ g
Flags:
Match Preview 0 matches
Matches will be highlighted here...

Match Details

No matches yet.

Summary

Type a regex pattern and test string to instantly see highlighted matches, capture groups, and a replacement preview — all in your browser using JavaScript RegExp.

How it works

  1. Enter a regex pattern in the Pattern field (without surrounding slashes).
  2. Toggle any flags you need — g (global), i (case-insensitive), m (multiline), s (dot-all), u (unicode), y (sticky).
  3. Paste or type the text you want to test in the Test String area.
  4. Matches are highlighted in yellow in real time. Expand the Replace section to preview substitutions using $1, $&, or named groups.

Use cases

  • Validating form input such as emails, phone numbers, and postal codes
  • Extracting structured data like IP addresses or timestamps from log files
  • Search-and-replace operations in code editors and data pipelines

Frequently Asked Questions

Last updated: 2026-06-09 · Reviewed by Nham Vu