Back to Tools
Regex Cheat Sheet
Regex Interactive Cheat Sheet
High-performance regular expression reference guide for elite developers
PRO REFERENCE
Character Classes
. Any character (except \n)
\d Any digit (0-9)
\w Word char (a-z, 0-9, _)
\s Whitespace char
[a-z] Range (a to z)
Quantifiers
* 0 or more times
+ 1 or more times
? 0 or 1 (Optional)
{n} Exactly n times
{n,m} Between n and m
Anchors & Logic
^ Start of line
$ End of line
\b Word boundary
| OR (Alternation)
(?:...) Non-capturing group
Lookarounds
(?=...) Positive Lookahead
(?!...) Negative Lookahead
(?<=...) Positive Lookbehind
(? Negative Lookbehind
Pro Tip: Click to Copy
Click any regex token in the list above to instantly copy it to your clipboard for use in our advanced tester.
About the Regex Cheat Sheet
A quick reference for regular expression syntax.
How to use the Regex Cheat Sheet
- Browse the sections to find the pattern you need, such as character classes, quantifiers, anchors and groups.
- Copy a pattern and test it in the Regex Validator or Regex Extractor.
| Pattern | Meaning |
|---|---|
| . | Any character except a new line |
| \d | A digit (0 to 9) |
| \w | A letter, digit or underscore |
| \s | A space, tab or line break |
| * + ? | Zero or more, one or more, zero or one |
| {n,m} | Between n and m repeats |
| ^ $ | Start and end of the line |
| ( ) | A capture group |
| | | Or |
Tips
- Test regexes on real sample data, including edge cases.
- Keep patterns as simple as possible.
Frequently Asked Questions
One or more digits in a row.