Regex Tester
Write a JavaScript regular expression, test it against your text, and see matches and capture groups instantly. Runs entirely in your browser.
| # | Match | Index | Groups |
|---|---|---|---|
| 1 | support@tallyloom.com | 12 | — |
| 2 | press@example.org | 37 | — |
| \d | digit 0–9 |
| \w | word char (letter, digit, _) |
| \s | whitespace |
| . | any char except newline |
| ^ $ | start / end of string (or line with m) |
| * | 0 or more |
| + | 1 or more |
| ? | 0 or 1 |
| {2,4} | between 2 and 4 |
| [abc] | any of a, b, c |
| [^abc] | not a, b, or c |
| (x|y) | x or y, captured |
| (?:x) | group without capturing |
| \b | word boundary |
How to use this tool
- Type your regular expression pattern (without surrounding slashes).
- Toggle flags: g for all matches, i for case-insensitive, m for multiline, s for dot-matches-newline.
- Paste your test text — matches highlight instantly, with index positions and capture groups listed below.
How it works
The tester runs your pattern with JavaScript's native RegExp engine, so behavior matches exactly what you'll get in Node.js or the browser. Note that regex dialects differ: patterns using PCRE-only features (like possessive quantifiers or recursion) won't work here, and lookbehind support depends on the engine version.
Capture groups — the parts of the pattern in parentheses — are shown per match as $1, $2, and so on, which is what you'd reference in a replace operation.
Frequently asked questions
What do the regex flags mean?
g finds all matches instead of just the first; i ignores case; m makes ^ and $ match at line breaks; s makes the dot match newline characters too.
Why does my pattern work here but not in another language?
Regex dialects differ. This tool uses JavaScript's engine; Python, PCRE (PHP), and Go each have their own quirks around lookbehind, named groups, and special escapes.
How do I match an email address?
A practical pattern is \b[\w.+-]+@[\w-]+\.[\w.]+\b. A fully RFC-compliant email regex is famously enormous — for real validation, match loosely and confirm with a verification email.