Regex Cheatsheet - Regular Expression Quick Reference
Quick reference for regular expression patterns. Character classes, quantifiers, anchors, and common patterns.
[A-Z]Uppercase letter
Example: [A-Z]+ → HELLO
[0-9]Digit
Example: [0-9]+ → 123
[a-zA-Z]Letter
Example: [a-zA-Z]+ → Hello
|Alternation
Example: cat|dog → cat or dog
\[Literal [
Example: \[abc\] → [abc]
\(Literal (
Example: \(abc\) → (abc)
iCase insensitive
Example: /hello/i → HELLO
gGlobal match
Example: /a/g → all a's
mMultiline
Example: /^a/m → a at line start
sDot matches newline
Example: /.+/s → includes \n
uUnicode
Example: /\u{1F600}/u → 😀
ySticky
Example: /\d+/y → consecutive digits
^[\w-]+@[\w-]+\.[\w-]+$Email address
Example: user@example.com
^https?://[^\s]+$URL
Example: https://example.com
^\d{4}-\d{2}-\d{2}$Date YYYY-MM-DD
Example: 2024-01-15
^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$IP address
Example: 192.168.1.1
^\+?[\d\s-()]{7,}$Phone number
Example: +86 138-0000-0000
^\d{6}$6-digit code
Example: 123456
\b[\w-]+\bWord
Example: hello-world
<[^>]+>HTML tag
Example: <div class="test">
\d{4}-\d{4}-\d{4}-\d{4}Credit card
Example: 1234-5678-9012-3456
^#[0-9A-Fa-f]{6}$Hex color
Example: #FF5733
^[A-Za-z0-9+/]{4}*[A-Za-z0-9+/]{2}==$Base64 encoded
Example: SGVsbG8=
^[A-Z][a-z]+([A-Z][a-z]+)*$CamelCase
Example: HelloWorldTest
70 of 70 patterns shown
Related Tools
More Text Tools
Set Operations
Perform set operations online: union, intersection, differen...
Duplicate Finder
Find and highlight duplicate lines in text online. Identify ...
Diff Checker
Compare two texts and highlight differences. Side-by-side di...
Regex Tester Pro
Advanced regular expression testing tool. Test, debug, and o...
Lorem Ipsum Generator
Generate Lorem Ipsum placeholder text online. Customizable l...
Text Replace
Find and replace text online with regex support. Batch text ...
Markdown to HTML Converter
Convert Markdown to HTML with live preview. Support headers,...
SVG Optimizer
Optimize SVG files by removing comments, metadata, empty att...
Markdown Table Generator
Build Markdown tables visually. Add/remove rows and columns,...
Text Deduplication
Remove duplicate lines from text online. Clean up data by el...
Markdown Preview
Live Markdown preview with syntax highlighting. Support GitH...
Text Diff Checker
Compare two texts side-by-side with instant diff highlightin...