Regex Tester
Test and debug regular expressions in real time — matches highlighted, groups captured
Common Patterns
Regex Quick Reference
Regular expressions have a concise syntax. \d matches any digit (0–9). \w matches any word character (letters, digits, underscore). \s matches whitespace. . matches any character except newline (use the s flag to include newlines). ^ matches the start of a line; $ matches the end.
Quantifiers control how many times something matches: + means one or more, * means zero or more, ? means zero or one, {n,m} means between n and m times. Add ? after a quantifier to make it non-greedy (match as few characters as possible).
Parentheses () create capture groups — the matched text is saved and can be referenced in replacements as $1, $2, etc. Square brackets [] define a character class: [a-z] matches any lowercase letter, [^0-9] matches anything except a digit.