Regex Cheat Sheet
Searchable reference for regex anchors, character classes, quantifiers, groups, lookaround and flags — click any symbol to copy it.
How to use this regex cheat sheet
Search or filter by category to find the regex syntax you need, then click the copy icon to grab the symbol. Pair this reference with the Regex Tester to try patterns live against sample text.
Common regex patterns
Email: ^[\w.-]+@[\w-]+\.[a-zA-Z]{2,}$ · URL: https?:\/\/[^\s]+ · digits only: ^\d+$
Frequently Asked Questions
What is the difference between greedy and lazy quantifiers?
Greedy quantifiers (*, +, ?, {n,m}) match as much text as possible. Lazy quantifiers (*?, +?, ??) match as little as possible. Add a ? after a greedy quantifier to make it lazy.
What is the difference between (abc) and (?:abc)?
(abc) is a capturing group — it saves the matched text and can be referenced later with \1 or in replacement strings. (?:abc) is a non-capturing group — it groups the pattern for quantifiers or alternation without storing the match.