Developer Utility

Regex Tester & Debugger

Live match highlighting, visual token explainer, replace mode, 25+ pattern library, ReDoS detector, and one-click export — the regex workbench built for speed.

Live Highlighting Visual Explainer Replace Mode 25+ Patterns ReDoS Detector JSON / CSV Export Share Links History
5Flags
25+Patterns
0msServer Lag
100%Free
60 / 60 exports left
ReDoS Risk Detected: This pattern contains nested quantifiers that may cause catastrophic backtracking on malicious input. Avoid using this pattern in production server-side code without input length limits.
Step 1 — Regular Expression
/ /
Type a pattern above to see token breakdown.
Step 2 — Test Strings
0 matches
Matches
0
Groups
0
Chars Matched
0
Test Length
0
Coverage
0%
Exec Time
Step 3 — Replace / Substitution
Use $1, $2 for capture group back-references. $& = entire match. $` = before match. $' = after match.
Enter a replacement string above to see the preview.
Step 4 — Match Results
# Match Position Length
No matches yet — enter a pattern and test string.
#Full Match
No capture groups found in your pattern.
#MatchStartEndLineColumn
No matches yet.

Run a match to see summary statistics.

Pattern Library — 25+ Ready-to-Use Patterns
Regex Cheat Sheet — Quick Reference
Character Classes
.Any character except newline
\wWord char: [a-zA-Z0-9_]
\WNon-word character
\dDigit: [0-9]
\DNon-digit
\sWhitespace (space, tab, newline)
\SNon-whitespace
[abc]Character class: a, b, or c
[^abc]Negated class: not a, b, or c
[a-z]Range: lowercase a to z
[A-Z]Range: uppercase A to Z
[0-9]Range: digits 0 to 9
Quantifiers
*Zero or more (greedy)
+One or more (greedy)
?Zero or one (optional)
{n}Exactly n times
{n,}n or more times
{n,m}Between n and m times
*?Zero or more (lazy)
+?One or more (lazy)
??Zero or one (lazy)
{n,m}?Between n,m times (lazy)
Anchors
^Start of string / line
$End of string / line
\bWord boundary
\BNon-word boundary
\AStart of string (no multiline)
\ZEnd of string (no multiline)
Groups & Lookarounds
(abc)Capture group
(?:abc)Non-capturing group
(?<name>…)Named capture group
(?=abc)Positive lookahead
(?!abc)Negative lookahead
(?<=abc)Positive lookbehind
(?<!abc)Negative lookbehind
a|bAlternation (a or b)
\1, \2Back-reference to group 1, 2
Flags
gGlobal — find all matches
iCase insensitive
mMultiline — ^ and $ match line ends
sDotAll — . matches newlines too
uUnicode mode
ySticky — match at exact position
Escape Sequences
\nNewline
\tTab
\rCarriage return
\0Null character
\uXXXXUnicode character (hex)
\xXXASCII hex character
\\Literal backslash
\.Literal dot (escape meta chars)
Live Match Highlighting
Matches are highlighted in real-time as you type. No submit button — instant feedback, zero server roundtrips.
Visual Token Explainer
Every token in your regex is colour-coded and labelled — anchors, quantifiers, groups, character classes. Perfect for learning.
Replace & Substitution
Live replace preview with full back-reference support ($1, $2, $&). Apply changes and copy the result in one click.
25+ Pattern Library
Email, URL, IPv4, IPv6, phone numbers, credit cards, dates, hex colours, slugs, JWT tokens and more — one click to load any pattern.
ReDoS Vulnerability Detector
Automatically flags patterns with nested quantifiers that may cause catastrophic backtracking — protecting your production server code.
JSON & CSV Export
Export all matches, capture groups, positions, and line/column info to JSON or CSV with one click.
Shareable Links
Generate a shareable URL that encodes your regex, flags, and test string. Share with teammates or bookmark for later.
Pattern History
Your last 10 patterns are saved locally in your browser. Reload any previous regex in one click without losing your current work.
Detailed Match Table
Every match shown with its index, value, start position, length, line number, column, and all capture group values.
FAQs

Common questions

This tool uses JavaScript regex (ECMA-262) — the same engine used in Node.js, Chrome, Firefox, and most modern browsers. It supports all standard features including lookaheads, lookbehinds, named capture groups, and unicode property escapes with the u flag.

JS / ECMA-262Named groupsLookbehind

No. All regex matching, highlighting, and replacement runs 100% in your browser using the JavaScript RegExp engine. Your patterns and test strings are never transmitted to any server. The only server call is for the optional JSON/CSV export endpoint, which is rate-limited to 60 requests per day.

ReDoS (Regular Expression Denial of Service) occurs when patterns with nested quantifiers like (a+)+ or overlapping character classes cause the regex engine to take exponential time on crafted inputs. The detector flags patterns containing common ReDoS-prone structures. It is a heuristic check — not a guarantee.

Heuristic only

Wrap part of your pattern in parentheses to create a capture group — e.g. (\d{4})-(\d{2})-(\d{2}) creates three groups for year, month, day. Groups are numbered left-to-right from 1. Use (?:...) for non-capturing groups when you need grouping without capture. Named groups use (?<name>...).

$1 $2 in replaceNamed: $<name>

Greedy quantifiers (*, +, ?) match as much as possible and give back only when required. Lazy versions (*?, +?, ??) match as little as possible. Example: against <b>bold</b>, the pattern <.*> matches the whole string (greedy), while <.*?> matches only <b> (lazy).