TL
Tool Lab
💰Donate
💰Donate

Regex Tester

Test regular expression patterns in real time. Supports match highlighting, capture groups, replacement, and flags.

Regular Expression
//gm
Test String
Matches

About This Tool

A real-time regex playground for testing patterns against strings. Supports match highlighting, capture groups, and replacement mode.

Use flags (g, i, m, s) to control matching behavior — global, case-insensitive, multiline, and dot-all.

How to Use

  1. Enter a regular expression pattern in the regex field.
  2. Type or paste the test string to match against.
  3. Toggle flags as needed (g, i, m, s).
  4. Switch to Replace mode to substitute matched text with a replacement string.

Use Cases

Useful for validating emails, URLs, phone numbers, parsing log files, and learning regex syntax interactively.

FAQ

  • What happens if my pattern has an error?An error message is displayed when the pattern is not a valid regular expression.
  • How do I see capture groups?Expand the Match Details section to see all capture groups for each match.
  • Can I reference capture groups in replace mode?Yes — use $1, $2, etc. in the replacement string to reference capture group 1, 2, and so on.