Regex Tester (Matches, Groups, and Replacement Preview)
Need to run a regex test quickly? Paste and verify immediately with this regex tester.
See highlighted matches, capture groups, and replacement output in one screen.
How to use
- Enter a pattern and choose the flags you need (g/i/m).
- Paste source text. If auto-run is ON, results update immediately.
- Use the match list to inspect locations and jump to each match.
- Use Groups and Replacement tabs to verify captures and replacement output.
Examples
Email extraction
Input: Text containing email addresses
Output: Highlighted matches and start/end positions
key=value replacement
Input: Multi-line key=value text
Output: Replacement output using $1 and $2
Log line filter
Input: Log text with INFO / WARN / ERROR
Output: Line-based matching with m flag
Replacement Cheat Sheet
- $1, $2 ... : capture group references
- $& : whole match
- $` : before match / $' : after match
Note
- This tool evaluates patterns using JavaScript (ECMAScript) regular expressions.
- Some PCRE features (such as atomic groups) are not available.
- Even JavaScript features can vary by runtime environment.
- Results are not guaranteed to be identical to PCRE.
FAQ
What are g/i/m flags?
Use checkboxes to toggle them. (g=global, i=ignore case, m=multiline)
Can I test replacement too?
Yes. Enter a replacement string and check the Replacement tab. Group references like $1 are supported.
How is this different from PCRE?
This tool uses JavaScript regular expressions. Because of spec differences, the same pattern may produce different results from PCRE.