ClickSail logo
ClickSail Free Tools
Knowledge Base

Regex Cheat Sheet — Complete Regular Expression Reference

A quick reference guide to regular expression syntax with examples. Use alongside ClickSail's free regex tester to build and test patterns in real time.

ClickSail Team
PUBLISHED — 2026

Anchors

Pattern Meaning
^ Start of string or line
$ End of string or line
\b Word boundary
\B Not a word boundary

Character Classes

Pattern Meaning
. Any character except newline
\d Any digit (0–9)
\D Any non-digit
\w Any word character (a-z, A-Z, 0-9, _)
\W Any non-word character
\s Any whitespace (space, tab, newline)
\S Any non-whitespace

Quantifiers

Pattern Meaning
* 0 or more
+ 1 or more
? 0 or 1 (optional)
{n} Exactly n times
{n,} n or more times
{n,m} Between n and m times

Common Regex Patterns

Email address:

^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

URL:

https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)

Frequently Asked Questions

What is the difference between + and * in regex?

+ matches one or more occurrences. * matches zero or more — meaning the pattern is optional.

What does ? do after a quantifier?

It makes the quantifier lazy (non-greedy), matching as few characters as possible instead of as many.

How do I match a literal dot in regex?

Use \. — a backslash before the dot. Without the backslash, . matches any character.

Is regex syntax the same in all languages?

The core syntax is consistent, but there are minor differences. ClickSail uses JavaScript regex syntax.

Is it free?

Yes. The cheat sheet and the tester are both completely free.

Test your pattern

Try your regex in our live tester.

Open Regex Tester
Status: Verified Knowledge

* All tools are browser-based and private.