Embed this tool on your site
<iframe src="https://devtoolbox.dedyn.io/tools/regex-debugger" width="100%" height="700" frameborder="0" title="Regex Debugger & Visualizer"></iframe>

Regex Debugger & Visualizer

Debug regular expressions with step-by-step match visualization, pattern explanation, code generation, and substitution. Everything runs in your browser.

/ /
g
i
m
s
u
 

Use $1, $2, etc. for capture group backreferences. $& for full match. $<name> for named groups.

Substitution result will appear here...
Character Classes
.Any character (except newline)
\dDigit [0-9]
\DNot a digit
\wWord char [a-zA-Z0-9_]
\WNot a word char
\sWhitespace
\SNot whitespace
[abc]Any of a, b, or c
[^abc]Not a, b, or c
[a-z]Range: a to z
Quantifiers
*0 or more
+1 or more
?0 or 1 (optional)
{n}Exactly n times
{n,}n or more times
{n,m}Between n and m
*?0 or more (lazy)
+?1 or more (lazy)
Anchors & Boundaries
^Start of string/line
$End of string/line
\bWord boundary
\BNot a word boundary
Groups & Lookaround
(abc)Capture group
(?:abc)Non-capturing group
(?<n>abc)Named group "n"
\1Backreference to group 1
(?=abc)Positive lookahead
(?!abc)Negative lookahead
(?<=abc)Positive lookbehind
(?<!abc)Negative lookbehind
a|bAlternation (a or b)
Flags
gGlobal (find all matches)
iCase-insensitive
mMultiline (^ $ per line)
sDotall (. matches \n)
uUnicode support

Frequently Asked Questions

What is regex debugging?
Regex debugging is the process of testing and understanding how a regular expression matches against input text. A debugger highlights matches, shows capture groups, and explains what each part of the pattern does, making complex regex easier to develop.
What are capture groups in regex?
Capture groups, defined by parentheses (), save the matched text for later reference. For example, (\d{3})-(\d{4}) matching '555-1234' creates group 1 ('555') and group 2 ('1234'). They're used for extraction and backreferences.
How do I make a regex case-insensitive?
Add the 'i' flag after your regex pattern. In most languages: /pattern/i in JavaScript, re.IGNORECASE in Python, Pattern.CASE_INSENSITIVE in Java, and (?i) inline flag in most regex engines.
Keyboard Shortcuts
Ctrl+Enter Run / Format
Ctrl+Shift+C Copy output
Ctrl+L Clear