Skip to content

Regex Cheatsheet

Every regex token, searchable, with an example of what it matches.

Quick Tool Overview

A searchable regular expression reference where every token comes with a worked example — because knowing that \b exists tells you nothing about what it matches.

What it does
Explains every regex token with an example
You give it
A token, or a description of what you want
You get back
The syntax, what it matches, and what it does not
Best for
Looking up syntax while writing a pattern
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the Regex Cheatsheet

A complete reference for regular expression syntax, searchable by the token itself or by what you are trying to do. Every entry has an example, because the syntax is only half the problem — knowing that \b exists does not tell you what it matches.

It covers character classes, quantifiers and their lazy forms, anchors, groups both capturing and not, lookahead and lookbehind in all four directions, backreferences, Unicode property escapes and every flag. The distinctions that cause the most confusion are called out: greedy against lazy, the dot not matching a newline by default, and why a dot inside a character class is just a dot. A set of ready-made patterns for email, URLs, dates and postcodes comes with it.

Key features of the Regex Cheatsheet

An example on every entry

A pattern, what it matches and — just as usefully — what it does not.

Search by intent

Type "start of line" or "optional" rather than having to already know the symbol.

The confusing pairs called out

Greedy against lazy, the dot not matching newlines, and why a dot inside a character class is just a dot.

All four lookarounds

Positive and negative, ahead and behind, with an example of each and a note on where lookbehind is unsupported.

Ready-made patterns

Email, URL, date, postcode and more — each with the caveat that goes with it, since none of them is truly complete.

How to use the Regex Cheatsheet

  1. 1

    Search for a token

    Type the syntax, or describe what you want to match.

  2. 2

    Read the example

    Each entry shows a pattern and what it does and does not match.

  3. 3

    Filter by category

    Classes, quantifiers, anchors, groups, lookaround or flags.

  4. 4

    Take a ready pattern

    Common patterns for email, URLs, dates and more, with their caveats.

Frequently asked questions

A greedy quantifier takes as much as it can and gives back only when forced; a lazy one, written with a trailing ?, takes as little as possible. On <.+> against two tags, greedy matches both and lazy matches the first.

Reviews of the Regex Cheatsheet

What people who use the Regex Cheatsheet think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Regex Cheatsheet. It takes half a minute and no account.

Write the first review

More developer tools