About the Regex Tester
Test a regular expression against sample text with live match highlighting, a numbered and named capture group table, and a replace preview. A built-in cheat sheet covers the most common tokens.
Test patterns, flags, captures, and replacements live.
| # | Match | Index | Groups |
|---|---|---|---|
| 1 | alice@example.com | 9 | $1=alice, $2=example.com, user=alice, domain=example.com |
| 2 | bob@example.org | 30 | $1=bob, $2=example.org, user=bob, domain=example.org |
.Any character except newline\d \w \sDigit, word character, whitespace\D \W \SNegated digit, word, whitespace* + ?Zero or more, one or more, zero or one{n,m}Between n and m repetitions^ $Start and end of string or line(...)Capture group(?<name>...)Named capture group(?:...)Non-capturing groupa|bAlternationTest a regular expression against sample text with live match highlighting, a numbered and named capture group table, and a replace preview. A built-in cheat sheet covers the most common tokens.
The browser RegExp engine compiles the pattern with the selected flags, then reports matches, capture groups, and replacement output against the supplied text.
Example: Test an email-like pattern against several sample lines and inspect named capture groups before using it in application validation.
JavaScript regular expressions are not interchangeable with every regex flavor. Complex patterns can be slow or vulnerable to catastrophic backtracking, and a passing test does not prove that a pattern is suitable for security validation.
No. Matching, group extraction, and replace preview all run locally in your browser after the page loads.
Yes. Named groups such as (?<user>\w+) appear alongside numbered groups in the match table.
Yes. The pattern and flags are stored in the URL. Test text is not, since it can contain sensitive data.
Was this useful?