Test regular expressions with live match highlighting
Write or paste a regex pattern and instantly see every match, capture group, and index position against your test string, with matches highlighted inline. Only the pattern's syntax is validated — the test string is simply what you're matching against, so you can iterate quickly while building a pattern.
Frequently Asked Questions
- What exactly does this tool validate?
- Only that your regex pattern itself compiles — if it has invalid syntax, you'll see an "Invalid regex" error. It does not validate your test string against anything; the test string is simply matched against your pattern to show you what matches, at what index, and what each capture group contains.
- What do the g, i, m, and s flags do?
- g (global) finds every match instead of stopping at the first one. i makes matching case-insensitive. m makes ^ and $ match the start/end of each line instead of the whole string. s (dotall) makes . match newline characters too.
- How are capture groups shown?
- Each match row in the Match Details table lists its capture groups in order. A group shows as "undefined" if it was part of the pattern but did not participate in that particular match (e.g. inside an alternation).
- Can I generate a pattern instead of writing one from scratch?
- Yes — use the Regex Generator to paste example text and get ready-made patterns for common formats like emails, URLs, dates, and IPs, then click "Test in Regex Tester" to open it here pre-filled.