Regex Tester
Test regular expressions with live match highlighting and groups.
Test string
Matches
Contact us at hello@dev-nest.online or support@example.com. Docs: https://dev-nest.online/regex-tester?theme=dark&lang=en Server 192.168.1.42 responded on 2026-09-26 (backup: 10.0.0.255). Brand colors: #6366f1, #7c3aed and #fff.
Regex quick reference
- .
- Any character except line breaks
- \d \w \s
- Digit, word character, whitespace
- \D \W \S
- Not a digit, word character, whitespace
- [abc] [^abc] [a-z]
- Any of, none of, range
- ^ $
- Start / end of string (or line with m)
- \b
- Word boundary
- * + ?
- 0 or more, 1 or more, 0 or 1
- {3} {2,} {2,5}
- Exactly 3, 2 or more, between 2 and 5
- *? +?
- Lazy (as few as possible)
- (abc)
- Capture group
- (?<name>abc)
- Named capture group
- (?:abc)
- Non-capturing group
- a|b
- a or b
- (?=abc) (?!abc)
- Lookahead, negative lookahead
- (?<=abc) (?<!abc)
- Lookbehind, negative lookbehind
- $1 $<name> $&
- In replacements: group 1, named group, whole match
About the Regex Tester
Build and debug regular expressions with instant feedback. Matches are highlighted in your test text as you type, and a details table lists every match with its position and capture groups — including named groups.
The tester uses your browser's JavaScript regex engine, so results match what you'll get in JavaScript and TypeScript code. Patterns run in a background thread with a time limit, so a runaway pattern can't freeze the page.
How to use the Regex Tester
- 1
Write a pattern
Type a regular expression, or start from a preset such as Email, URL or IPv4.
- 2
Set flags
Toggle flags like g (global), i (ignore case) and m (multiline) with one click.
- 3
Add test text
Matches are highlighted live, and the details table shows each match's groups.
- 4
Try a replacement
Turn on Replace to preview the result using $1, $<name> or $& references.
Frequently asked questions
Which regex flavor does this tester use?
It uses the JavaScript (ECMAScript) regular expression engine built into your browser. Most syntax is shared with other languages, but some features differ — for example, JavaScript doesn't support possessive quantifiers or inline modifiers like (?i).
What do the g, i, m, s, u and y flags do?
g finds all matches instead of just the first, i ignores case, m makes ^ and $ match at line breaks, s lets the dot match line breaks, u enables full Unicode features such as \p{L}, and y (sticky) only matches at the current position.
How do I use capture groups in a replacement?
Use $1, $2 and so on for numbered groups, $<name> for named groups, and $& for the whole match. For example, replacing (\w+)@(\w+) with $2 at $1 swaps the two parts.
Why was my pattern stopped for taking too long?
Some patterns, such as (a+)+$, can take exponential time on certain inputs — this is called catastrophic backtracking. The tester stops any match that runs longer than one second. Make nested quantifiers more specific or use more precise character classes.
Why does my regex match an empty string?
Quantifiers like * and ? allow zero occurrences, so a pattern like \d* matches an empty string at every position. Use + instead of * if at least one character is required.
More free developer tools
JSON Formatter
Beautify, minify and validate JSON instantly as you type.
Base64 Encoder/Decoder
Convert text to Base64 and back, with full Unicode support.
UUID Generator
Generate random v4 UUIDs — one or many — in the format you need.
JWT Decoder
Decode JSON Web Tokens to inspect the header, payload and expiry.
Timestamp Converter
Convert Unix timestamps to dates and dates to timestamps.
URL Encoder/Decoder
Percent-encode and decode URLs, and break down query strings.
Hash Generator
Generate MD5, SHA-1, SHA-256 and SHA-512 hashes of text or files.