Regex Tester
Test regular expressions with live match highlighting.
Explanation
Plain-English breakdown of every token in the pattern
(start of a capture group\w+matches any word character (letter, digit or underscore), repeated one or more times)end of the group@matches the literal text "@"(start of a capture group\w+matches any word character (letter, digit or underscore), repeated one or more times)end of the group\.matches the literal character "."commatches the literal text "com"
g — global — find every match, not just the firstCommon patterns
Click to load into the pattern field
Test string
Capped at 20,000 characters to avoid catastrophic backtracking.
Highlighted matches
Capture groups
| # | Match | Index | Groups |
|---|---|---|---|
| 1 | ada@example.com | 9 | ada, example |
| 2 | alan@test.com | 26 | alan, test |
Replace preview
About the Regex Tester
Write and test regular expressions with live highlighted matches, a capture group table, a replace preview, and a cheatsheet of common patterns. Input length is capped to avoid catastrophic backtracking.
Examples
Email match
(\w+)@(\w+)\.comOutput
Matches ada@example.comKeyboard shortcuts
- Copy the main outputCtrl / ⌘ + Shift + C
- Download the resultCtrl / ⌘ + S
- Share this toolCtrl / ⌘ + Shift + S
- Reset the inputsAlt + R
- Open the tool search paletteCtrl / ⌘ + K
Related tools
Regex Cheatsheet
Dev Utilities
Searchable regex syntax reference with examples and copy buttons.
Code Comment Stripper
Dev Utilities
Remove comments from JS, HTML, Python, or SQL source.
Code Screenshot Generator
Dev Utilities
Turn code snippets into shareable syntax-highlighted images.
Line Sorter & Deduper
Dev Utilities
Sort, dedupe, and filter lines with regex include/exclude.
Markdown TOC Generator
Dev Utilities
Build a linked table of contents from Markdown headings.
String Escaper
Dev Utilities
Escape and unescape strings for JSON, JS, HTML, XML, SQL, RegExp, and shell.
Frequently asked questions
Read more
- Regex patterns every developer should know
A working set of regular expressions for emails, URLs, whitespace and validation — plus how to test them safely.
- Writing safer regular expressions: avoiding catastrophic backtracking
ReDoS bugs come from a small number of recognizable patterns. Here's how to spot them and write regexes that stay fast on any input.
- Regex lookahead and lookbehind in practice
What (?=...), (?!...), (?<=...) and (?<!...) actually do, with real patterns for passwords, numbers and text extraction.
Version 1.0.0 · Updated 2026-08-06 · Runs entirely in your browser