Writer & Dev
RegEx Cheatsheet: Regular Expression Syntax, Flags and Recipes
Look up regular expression syntax fast and copy tested recipes for emails, URLs, IPs, dates, hex colours and UUIDs. Every pattern is one click away from the regex tester.
Runs in your browser — your text is never uploaded or stored.
Quick answer
RegEx Cheatsheet Generator is a free online tool that look up regular expression syntax fast and copy tested recipes for emails, URLs, IPs, dates, hex colours and UUIDs. Every pattern is one click away from the regex tester.
- Cost: free, no signup or limits.
- Privacy: runs 100% in your browser; text is never uploaded.
- Works on: desktop and mobile browsers, offline once loaded.
- Category: Writer & Dev.
Ready-made patterns
Email address
[\w.+-]+@[\w-]+\.[\w.-]+matches: hello@snipptext.com
URL
https?:\/\/[^\s"'<>]+matches: https://snipptext.com/tools
IPv4 address
\b(?:\d{1,3}\.){3}\d{1,3}\bmatches: 192.168.1.10
Date YYYY-MM-DD
\d{4}-\d{2}-\d{2}matches: 2026-08-19
Hex color
#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})\bmatches: #1f8a70
UUID v4
[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}matches: 3f1c9a2e-4b7d-4f2a-9c1e-6b0a1d2e3f44
Phone (international)
\+?\d[\d\s().-]{7,}\dmatches: +44 20 7946 0958
Whitespace runs
\s{2,}matches: too many spaces
HTML tag
<\/?[a-zA-Z][^>]*>matches: <div class="x">
Slug
^[a-z0-9]+(?:-[a-z0-9]+)*$matches: regex-cheatsheet
Character classes
.Any character except newline\dDigit 0-9\DNot a digit\wWord character [A-Za-z0-9_]\WNot a word character\sWhitespace[abc]Any of a, b or c[^abc]Not a, b or c[a-z]Range a to zQuantifiers
*0 or more+1 or more?0 or 1 (optional){3}Exactly 3{2,}2 or more{2,5}Between 2 and 5*?Lazy — as few as possibleAnchors & boundaries
^Start of string / line$End of string / line\bWord boundary\BNot a word boundaryGroups & lookaround
(abc)Capturing group(?:abc)Non-capturing group(?<name>abc)Named groupa|bAlternation: a or b(?=abc)Positive lookahead(?!abc)Negative lookahead(?<=abc)Positive lookbehindFlags
gGlobal — all matchesiCase insensitivemMultiline ^ and $sDot matches newlineuUnicodeHow to Use
- 1.Search the cheatsheet for the token or concept you need.
- 2.Browse the recipe list for a ready-made pattern such as email or IPv4.
- 3.Copy the pattern and test it against your own text in the regex tester.
Advertisement
FAQ
Which regex flavour is this?
JavaScript (ECMAScript) regex, which is close to PCRE for everyday patterns.
Can I test the patterns here?
Yes — each recipe includes a sample string and links straight to the regex tester tool.
Is lookbehind supported?
Yes in modern browsers. Lookbehind works in Chrome, Edge, Firefox and Safari 16.4 or newer.
Related tools
Regex Tester
Free online regex tester for JavaScript. Test regular expressions with live match highlighting, groups, flags and replace preview. 100% browser-based.
Find and Replace
Find and replace text in your browser with match-case, whole-word and replace-all options. Free, private and instant.
Extract Emails
Pull every email address out of any pasted text into a clean, deduplicated list. Free, private and instant in your browser.
Extract URLs
Pull every URL out of any pasted text into a clean, deduplicated list. 100% private and runs in your browser.