Regex Tester

Test, explain, and debug regular expressions with syntax highlighting, explanation panel, quick reference, and live match preview.

//

Enter a regex pattern to see explanation and matches

Explanation

gglobal — find all matches, not just the first

Quick Reference

Character Classes

\ddigit (0-9)
\wword char (a-z, A-Z, 0-9, _)
\swhitespace (space, tab, newline)
.any character except \n
\D \W \Sinverse of \d \w \s

Quantifiers

*0 or more (greedy)
+1 or more (greedy)
?0 or 1 (greedy)
{n}exactly n times
{n,m}n to m times
{n,}n or more times
*? +?lazy (non-greedy) versions

Groups & Lookaround

(...)capture group — stores match in $1, $2...
(?:...)non-capturing group — no backreference
(?<name>...)named group — access by name
(?=...)positive lookahead
(?!...)negative lookahead
(?<=...)positive lookbehind
(?<!...)negative lookbehind

Anchors & Boundaries

^start of string (or line w/ m flag)
$end of string (or line w/ m flag)
\bword boundary
\Bnon-word boundary

Alternation & Misc

|OR — match left or right side
\escape next character
[...]character set — match any inside
[^...]negated set — match anything NOT inside

Shorthand Examples

\d{3}-\d{4}phone pattern (3 digits — 4 digits)
\w+@\w+\.\w+simple email pattern
https?://.*URL starting with http(s)
^[A-Z][a-z]+$capitalized word (full line)

Online Regex Tester & Explainer

Write, test, and understand regular expressions with live visual feedback. The pattern input supports syntax highlighting: character classes appear in blue, quantifiers in green, anchors in red, groups in purple, and alternation in orange. A token bar below the input mirrors the breakdown, and hovering any token (or its matching explanation row) highlights both in yellow for quick cross-referencing.

The right sidebar contains a detailed Explanation panel that translates each part of your regex into plain English, plus a searchable Quick Reference covering character classes, quantifiers, groups, lookaround assertions, anchors, and common shorthand patterns. Supports all JavaScript regex features: lookahead/lookbehind assertions, named groups, Unicode property escapes, and dotAll mode.

Switch to Replace mode to test substitutions with $1/$2 backreferences and see a live preview. All processing happens locally in your browser — no data is ever uploaded to a server.