Regex Cheat Sheet
Transform, format, and optimize your data instantly with this free client-side tool.
Character Classes
Any character except newline
Word character (a-z, A-Z, 0-9, _)
Non-word character
Digit (0-9)
Non-digit
Whitespace (space, tab, newline, etc.)
Non-whitespace
Any character in the set (a, b, or c)
Any character NOT in the set
Any character in the range a to z
Anchors
Start of string (or line in multi-line mode)
End of string (or line in multi-line mode)
Word boundary (between word and non-word characters)
Non-word boundary
Absolute start of string
Absolute end of string
Quantifiers
Zero or more occurrences
One or more occurrences
Zero or one occurrence (optional)
Exactly n occurrences
n or more occurrences
Between n and m occurrences
Zero or more, lazy (match as few as possible)
One or more, lazy
Groups
Capture group (matches 'abc' and remembers the match)
Non-capturing group
Named capture group
Backreference to capture group 1
Alternation (a OR b)
Lookarounds
Positive lookahead (matches if followed by 'abc')
Negative lookahead (matches if NOT followed by 'abc')
Positive lookbehind (matches if preceded by 'abc')
Negative lookbehind (matches if NOT preceded by 'abc')
Modifiers
Global search (find all matches, not just the first)
Case-insensitive search
Multi-line search (^ and $ match start/end of lines)
Dotall mode (. matches newlines)
Advanced
Explore advanced configurations for Regex
Performance tuning best practices for Regex
Run security checks and validation for Regex
🔥 Similar Tools
Explore LibraryFrequently Asked Questions
Got questions? We've got answers.