Regex Tester
Write a regular expression and see every match and group highlighted live.
Runs in your browser — nothing is uploaded
Highlighted matches
3 matches
Contact jane.doe@example.com or support@everylittletool.com. Old address: j.doe@mail.example.org (no longer used)
Match details
| # | Index | Match | Groups |
|---|---|---|---|
| 1 | 8 | jane.doe@example.com | $1 jane.doe $2 example.com |
| 2 | 32 | support@everylittletool.com. | $1 support $2 everylittletool.com. |
| 3 | 74 | j.doe@mail.example.org | $1 j.doe $2 mail.example.org |
How to use Regex Tester
- 1
Type your pattern between the slashes in Regular expression, without the surrounding / characters.
- 2
Tick the flags you need: g for all matches, i to ignore case, m for multiline, s so the dot matches newlines, u for Unicode.
- 3
Paste sample text into Test text and watch matches highlight as you type.
- 4
Check Match details for each match's position and capture groups, and select Copy regex to copy the full /pattern/flags literal.
About this tool
Patterns run on your browser's own JavaScript regex engine, so the results match what new RegExp() does in your code in Chrome, Firefox, Safari or Node.js. Other languages such as Python, PHP (PCRE), Java and .NET share most syntax but differ in details like lookbehind support, possessive quantifiers and named-group syntax, so test there too if you are porting a pattern.
With the g flag every match is listed; without it only the first match is, just like RegExp.exec. Match details shows the zero-based index where each match starts, every numbered group ($1, $2…) and any named groups written as (?<name>…). Groups that did not take part in a match are shown as undefined. Zero-length matches, such as those from ^ or lookaheads, appear in the list but are not highlighted, because there is nothing to mark. To keep the page responsive, at most 1,000 matches are listed.
Useful checks: m makes ^ and $ match at each line, s lets . match line breaks, and u enables \p{…} Unicode property escapes such as \p{L} for any letter. A pattern with nested quantifiers like (a+)+ can take exponentially long on some inputs; if typing feels slow, simplify the pattern.
Your pattern and text never leave your browser.
Questions people ask
Which regex flavour does this tester use?
JavaScript (ECMAScript), executed by your browser. It is the flavour used in web apps, Node.js and TypeScript.
Why does my regex only find one match?
Without the g (global) flag, JavaScript stops at the first match. Tick g to find them all.
How do I match across multiple lines?
Tick m so ^ and $ match at line breaks, and tick s if you need . to match newline characters too.
How do I use named capture groups?
Write (?<name>pattern). The group appears by name in Match details and can be used as $<name> in replacements.
Related tools
- Find and ReplaceReplace every match in a block of text, with plain text or regex.
- JSON FormatterBeautify, minify and validate JSON, with errors pinpointed to the line.
- URL Encode & DecodePercent-encode text for a URL, or decode an encoded URL back to text.
- Base64 Encode & DecodeEncode and decode Base64 text, or turn any file into a data URL.
- Hash GeneratorCalculate MD5 and SHA hashes of text or a file, and check a checksum.
- JWT DecoderPaste a JWT to read its header, payload and expiry time.