Loading...
Loading...
Free interactive regular expression cheatsheet with examples. Quick reference for regex patterns, syntax, and common matching expressions.
.Any character except newline
\wWord character (a-z, A-Z, 0-9, _)
\w+ matches 'hello_123'
\WNon-word character
\dDigit (0-9)
\d{3} matches '123'
\DNon-digit
\sWhitespace (space, tab, newline)
\SNon-whitespace
[abc]Match a, b, or c
[aeiou] matches any vowel
[^abc]Not a, b, or c
[^0-9] matches non-digits
[a-z]Range: a to z
[A-Za-z] matches any letter
*Zero or more
ab*c matches 'ac', 'abc', 'abbc'
+One or more
ab+c matches 'abc', 'abbc' (not 'ac')
?Zero or one (optional)
colou?r matches 'color' and 'colour'
{n}Exactly n times
\d{4} matches '2024'
{n,}n or more times
{n,m}Between n and m times
\d{2,4} matches '12', '123', '1234'
*?Zero or more (lazy/non-greedy)
+?One or more (lazy/non-greedy)
^Start of string/line
^Hello matches 'Hello World'
$End of string/line
world$ matches 'Hello world'
\bWord boundary
\bcat\b matches 'cat' in 'the cat sat'
\BNon-word boundary
(abc)Capture group
(\d{3})-(\d{4}) captures area code
(?:abc)Non-capturing group
(?<name>abc)Named capture group
(?<year>\d{4})
a|bAlternation (a or b)
cat|dog matches 'cat' or 'dog'
\1Backreference to group 1
(?=abc)Positive lookahead
\d(?=px) matches '5' in '5px'
(?!abc)Negative lookahead
\d(?!px) matches '5' in '5em'
(?<=abc)Positive lookbehind
(?<=\$)\d+ matches '100' in '$100'
(?<!abc)Negative lookbehind
gGlobal: match all occurrences
iCase-insensitive matching
mMultiline: ^ and $ match line boundaries
sDotall: . matches newline
uUnicode support
\nNewline
\tTab
\rCarriage return
\Escape special character
\. matches literal dot
\0Null character
^[\w.-]+@[\w.-]+\.\w{2,}$Email address
https?://[\w.-]+(:\d+)?(/\S*)?URL
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\bIPv4 address
\d{4}-\d{2}-\d{2}Date (YYYY-MM-DD)
\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}US phone number
#?([a-fA-F0-9]{3}|[a-fA-F0-9]{6})\bHex color code
Interactive regular expression reference covering character classes, quantifiers, anchors, groups, lookaheads, and flags with real-world examples. Each pattern includes a description, example input/output, and common use cases.
Regular expressions are powerful but notoriously difficult to memorize. This interactive cheatsheet provides instant access to every regex concept with practical examples, eliminating the need to search external documentation.
Developers writing or debugging regex patterns, data analysts building data extraction pipelines, QA engineers validating input formats, and students learning regular expressions.
Browse regex patterns by category: Character Classes, Quantifiers, Anchors, Groups, Lookarounds, Flags
Click on any pattern to expand its description and examples
Use the copy button to copy the regex snippet to your clipboard
Read the example input/output to understand how each pattern behaves
Combine patterns by referencing multiple sections for complex regex construction
Category: Character Classes. Pattern: \d matches digits, \w matches word characters, \s matches whitespace. Example: \d{3}-\d{4} matches '555-1234'.Category: Lookarounds. Pattern: (?=...) positive lookahead. Example: \w+(?=@) matches 'user' in '[email protected]' without including the @ symbol.Free online word counter and text analyzer tool. Count words, characters, sentences, and analyze readability with Flesch reading ease scores.
Free online regex tester and debugger with real-time matching, capture groups, and extended flag support. Test and debug regular expressions easily.
Free online Markdown preview editor with live syntax highlighting. Write and preview Markdown documents in real-time with formatted output.
Free online IP address calculator and subnet tool. Calculate subnet masks, CIDR notation, host ranges, and network addresses for IPv4.
Free online JSON formatter and validator with syntax highlighting. Beautify, validate, and minify JSON data instantly with real-time error detection.
Free online Base64 encoder and decoder tool for developers. Instantly convert text and files to Base64 format and decode Base64 strings back to readable text.
Free online JWT decoder and analyzer for developers. Inspect JSON Web Token headers, payloads, and signatures with detailed breakdown and validation.
Dive deeper with our comprehensive guides and tutorials.