Regex Debugger — Debug and Understand Regular Expressions

Debug any regex pattern with a plain-English token-by-token explainer, real-time match highlighting, and automatic detection of catastrophic backtracking. Understand what every part of a pattern does.

The Plain-English Explainer

Complex regex can be unreadable even for experienced developers. The Explainer tab takes any pattern and breaks it down token by token. Each piece is shown with its syntax color and a plain-English description. Group nesting is indicated with indentation. You can quickly verify that a pattern does what you think it does.

Detecting Performance Problems

Regex patterns can have hidden performance traps. Catastrophic backtracking happens when nested quantifiers create exponentially many paths: (a+)+b tested against "aaaaaaaaa" tries 2^n combinations. This tool runs regex in a sandboxed Web Worker with a 2-second timeout. If your pattern times out, you get a warning and suggestions for restructuring.

Step-by-Step Debugging Process

1. Paste the pattern and check if it's valid (green checkmark vs red error). 2. Read the explainer to understand what each token does. 3. Paste test data and verify matches highlight correctly. 4. Check groups in the match list below. 5. Adjust and re-test until the pattern matches exactly what you need.

Paste your regex below to debug it.

/
/g
✅ Valid pattern
No matches

Plain-English Breakdown

(Start of capturing group 1
\wMatch any word character (letter, digit, _)
+One or more times
)End of group
\sMatch any whitespace
(Start of capturing group 2
\wMatch any word character (letter, digit, _)
+One or more times
)End of group