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
- Enter a regular expression pattern in the regex field.
- Type or paste the test string to match against.
- Toggle flags as needed (g, i, m, s).
- 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.