About this tool
A regular expression describes matching locations in text. The tester uses the browser JavaScript RegExp engine with common flags, named groups, global matching, and highlighting, plus editable starting patterns for common shapes such as email, URLs, and numbers.
Regex is useful for local text patterns, not as a universal parser. Nested syntax, complete HTML, variable date dialects, and natural language usually need dedicated parsers. Overly broad expressions or catastrophic backtracking can also stall on long text.
How to use it
Enter the pattern and flags
Do not include host-language slash delimiters. Enable g, i, m, s, u, or y only when their behavior is needed.
Add representative test text
Include positive examples, boundary cases, and values that must not match instead of testing success alone.
Review highlights and groups
Check match count, complete spans, and capture groups, then preserve the same flags in destination code.
Input and output example
Named groups let you read results by name instead of remembering which bracket was which.
/(?<year>\d{4})-(?<month>\d{2})/g
Effective 2026-08, expires 2027-01Match 1: 2026-08 year=2026 month=08
Match 2: 2027-01 year=2027 month=01Supported range and limits
- Regex dialect
- JavaScript RegExp. Parts of Python, PCRE and Java syntax do not apply here
- Supported flags
- g global, i case-insensitive, m multiline, s dotall, u Unicode, y sticky
- Named groups
- (?<name>...) named capture is supported and shown by name in the results
- Not supported
- Recursion, conditionals, and some PCRE-only assertion forms
- Performance trap
- Nested quantifiers such as (a+)+ cause catastrophic backtracking on long non-matching input and can freeze the page
- Where it runs
- Executed with the browser's native RegExp; your test text is never uploaded
When you would use it
Cleaning logs and lists
Locate timestamps, IDs, blank lines, or fixed prefixes before extracting or replacing them in code.
Checking an input shape
Perform a quick client-side check for a stable identifier, path, or tag format with limited rules.
Reproducing a match failure from production
When a live regex misses or over-matches, paste the real input and adjust it here; far quicker than editing code and redeploying.
What to know before you start
- JavaScript regex syntax and features differ from PCRE, Python, and Java. Retest before moving a pattern across languages.
- Without the g flag, a search normally returns only the first match. Use global mode when all results matter.
- Do not parse complete HTML, XML, or a programming language with one large regex; a structural parser is safer.
Related concepts
- capture group
- A parenthesized part of a match retained for extraction or replacement; named groups are addressed by name.
- catastrophic backtracking
- An exponential search caused by certain nested repetitions and alternatives, consuming heavy CPU on crafted input.