Regex Tester
Contact: alice@example.com, bob@test.org
Contact: alice [at] example, bob [at] test
Related external tools
Some links are affiliate links.
Related tools
Test and debug a regular expression instantly. Type a pattern and some text to see matches highlighted live, inspect capture groups, count the matches, and preview a replacement with $1-style backreferences. Toggle flags on and off and get a clear message when a pattern is invalid. Everything runs in your browser — your text is never uploaded.
How to use
- Type your regular expression in the pattern field.
- Turn flags on or off (g for all matches, i for case-insensitive, and more).
- Paste the text you want to test against.
- See matches highlighted, review capture groups, and try a replacement.
What the flags mean
Flags change how the pattern is applied. The most common are g (find every match) and i (ignore case). Here is what each one does:
- g
- Global — find all matches, not just the first
- i
- Ignore case — match upper and lower case alike
- m
- Multiline — ^ and $ match the start/end of each line
- s
- Dotall — the dot . also matches newlines
- u
- Unicode — full Unicode and \u{...} support
- y
- Sticky — match only from the current position
Features
Live match highlighting
Every match is highlighted in your text as you type, so you can see exactly what the pattern catches.
Capture groups
See the value of each numbered and named capture group for every match, perfect for extracting parts of a string.
Match count
Know how many matches were found at a glance — useful for validating or counting occurrences.
Replace preview
Try a replacement string with $1, $2 or $<name> backreferences and see the rewritten text immediately.
Instant flag toggles
Switch g, i, m, s, u and y on or off and watch the results update right away.
Clear error messages
Invalid patterns show a readable error instead of failing silently, so you can fix them fast.
Common patterns
\d+One or more digits[A-Za-z]+One or more letters\w+@\w+\.\w+A simple email-like pattern^https?://\S+A URL at the start of a line\b\w{4,}\bWhole words with at least 4 letters(\d{4})-(\d{2})-(\d{2})A date like 2024-01-31 with capture groupsNotes & tips
- This tester uses JavaScript (ECMAScript) regex syntax, the same as in browsers and Node.js.
- Backreferences in the replacement use $1, $2, or $<name> for named groups.
- A very complex pattern can be slow on large text, since it runs on your device.
- Nothing is uploaded — your pattern and text stay in your browser.
Frequently asked questions
- Which regex flavor does this use?
- It uses JavaScript (ECMAScript) regular expressions, the same engine used by web browsers and Node.js.
- How do I get capture groups?
- Wrap part of your pattern in parentheses, like (\d+). Each group's value appears under every match, including named groups written as (?<name>...).
- What does $1 mean in the replacement?
- $1, $2 and so on insert the text captured by the matching parentheses. Use $<name> for named groups.
- What do the g and i flags do?
- g finds all matches instead of just the first; i makes the match case-insensitive. You can combine flags freely.
- Is my text uploaded?
- No. The pattern and your test text are processed entirely in your browser. Nothing is sent to a server.