SkyBrance Logo
SkyBrance
Menu
Free Tool

Regex Cheat Sheet

Quick reference for regular expression patterns. Searchable with examples. Click any pattern to copy.

Character Classes

Any character except newline

a.c โ†’ abc, a1c, a-c

Digit (0-9)

\d+ โ†’ 123, 42

Non-digit

\D+ โ†’ abc, !@#

Word character (a-z, A-Z, 0-9, _)

\w+ โ†’ hello_world

Non-word character

\W+ โ†’ @#$, !!

Whitespace (space, tab, newline)

a\sb โ†’ a b, a\tb

Non-whitespace

\S+ โ†’ hello

Any character in the set

[aeiou] โ†’ vowels

Any character NOT in the set

[^0-9] โ†’ non-digits

Character range (lowercase)

[a-z]+ โ†’ hello

Any letter

[A-Za-z]+ โ†’ Hello

Quantifiers

0 or more

ab*c โ†’ ac, abc, abbc

1 or more

ab+c โ†’ abc, abbc (not ac)

0 or 1 (optional)

colou?r โ†’ color, colour

Exactly n times

\d{3} โ†’ 123, 456

n or more times

\d{2,} โ†’ 12, 123, 1234

Between n and m times

\d{2,4} โ†’ 12, 123, 1234

0 or more (lazy/non-greedy)

<.*?> โ†’ shortest match

1 or more (lazy/non-greedy)

.+? โ†’ single char at a time

Anchors & Boundaries

Start of string/line

^Hello โ†’ starts with Hello

End of string/line

world$ โ†’ ends with world

Word boundary

\bcat\b โ†’ cat (not catch)

Non-word boundary

\Bcat โ†’ concatenate

Exact match (anchored)

^\d+$ โ†’ only digits

Groups & Alternation

Capturing group

(\d+) โ†’ captures digits

Non-capturing group

(?:ab)+ โ†’ ab, abab

Alternation (OR)

cat|dog โ†’ cat or dog

Backreference to group 1

(\w+)\s\1 โ†’ word word

Positive lookahead

\d(?=px) โ†’ digit before px

Negative lookahead

\d(?!px) โ†’ digit NOT before px

Positive lookbehind

(?<=\$)\d+ โ†’ digits after $

Negative lookbehind

(?<!\$)\d+ โ†’ digits NOT after $

Named capturing group

(?<year>\d{4}) โ†’ named year

Flags

Global - find all matches

/abc/g โ†’ all occurrences

Case-insensitive

/abc/i โ†’ ABC, abc, Abc

Multiline - ^ and $ match line starts/ends

/^hello/m โ†’ per line

Dotall - . matches newlines too

/a.b/s โ†’ a\nb

Unicode support

/\p{L}/u โ†’ any letter

Common Patterns

Email (basic)

user@example.com

URL (basic)

https://example.com/path

IPv4 address

192.168.1.1

Hex color

#ff5733, #ABC

Date (YYYY-MM-DD)

2024-01-15

Phone (E.164)

+14155551234

Strong password

Min 8, upper+lower+digit

About the Regex Cheat Sheet

The Regex Cheat Sheet is a free online tool that lets you quick reference for regex patterns with examples. Click to copy. It runs entirely in your browser with no sign-up required, so you get instant results while your data stays on your device. It is built for developers, designers, and anyone who needs a fast, reliable regex cheat sheet without installing software.

How to use the Regex Cheat Sheet

  1. 1Open the Regex Cheat Sheet and enter or paste your input.
  2. 2Adjust the available options to match what you need.
  3. 3View the result instantly as you work.
  4. 4Copy or download the output to use in your project.

Frequently asked questions

Is the Regex Cheat Sheet free to use?

Yes. The Regex Cheat Sheet is completely free with no account, sign-up, or installation required.

Is my data private when I use the Regex Cheat Sheet?

This tool runs entirely in your browser. Your data is never uploaded to a server, which makes it safe to use with sensitive input.

Do I need to install anything?

No. The Regex Cheat Sheet works in any modern web browser on desktop or mobile, with nothing to download.

Can I use the Regex Cheat Sheet on mobile?

Yes. The tool is responsive and works on phones, tablets, and desktops.

Build more with SkyBrance

Beyond free tools, SkyBrance offers branded link shortening with real-time analytics and dynamic QR codes with scan tracking.