Runs 100% in your browser — nothing is uploaded
Regex & Cron

Regex Cheat Sheet

Searchable reference for regex anchors, character classes, quantifiers, groups, lookaround, and flags — with copyable syntax and live examples.

Regex Cheat Sheet
Client-side

About this tool

The Regex Cheat Sheet is a fast, searchable reference for regular expression syntax, organized into the categories developers actually reach for while writing a pattern: Anchors, Character classes, Quantifiers, Groups (capturing, non-capturing, named, and backreferences), Lookahead/Lookbehind assertions, Flags, and a handful of Common patterns for email, URL, and IPv4 shapes.

Every entry pairs the exact syntax token with a plain-language description and a concrete before/after example, so you are not left guessing whether \B means "boundary" or "not a boundary." A one-click Copy button sits next to every syntax token, and a "Try it in Regex Tester" link takes you straight to the live pattern tester.

The search box filters across syntax, description, and category simultaneously — type "lookahead," "\d," or "greedy" and matching entries surface instantly. Category pill buttons let you narrow the view to just Anchors, just Quantifiers, and so on.

The email, URL, and IPv4 patterns in the Common Patterns section are explicitly flagged as simplified and illustrative — they are useful starting points but are not RFC-perfect and should not be relied on as the sole validation layer for security- or correctness-critical inputs.

FAQ

Are the email/URL/IPv4 patterns production-ready?
No — they are simplified, illustrative patterns meant to cover the common case quickly. Full RFC 5322 email and RFC 3986 URL validation require far more complex expressions. Pair a simplified regex with server-side verification rather than relying on regex alone.
What is the difference between a capturing and non-capturing group?
A capturing group (...) saves the matched substring for later reference. A non-capturing group (?:...) groups a sub-pattern for quantifiers or alternation without saving the match.
When should I use a named group instead of a numbered one?
Named groups are clearer in patterns with several groups, since match.groups.name is far more readable than match[3], and they stay stable if you reorder or add groups later.
What is the difference between lookahead and lookbehind?
Lookahead asserts something about the text that follows the current position; lookbehind asserts something about the text that precedes it. Both are zero-width — they check a condition without consuming characters.
Can I click an entry to test it live?
Each entry has a "Try it in Regex Tester" link that takes you to the Regex Tester tool, where you can paste the syntax or example and experiment against your own test string.