Search AnyKit Tools

Type a tool name, tag, or category to quickly open any tool instantly.

Regex Cheat Sheet

New

Regular expression syntax reference

Click pattern to copy

Character Classes

Any Character

.

Any character except newline

Word

\w

A-Z, a-z, 0-9, and underscore

Digit

\d

Any digit 0-9

Whitespace

\s

Space, tab, newline

Non-Word

\W

Anything NOT a word character

Non-Digit

\D

Anything NOT a digit

Quantifiers

Zero or More

*

Match 0 or more times

One or More

+

Match 1 or more times

Optional

?

Match 0 or 1 time

Exact Count

{n}

Match exactly n times

Range Count

{n,m}

Match between n and m times

Anchors & Boundaries

Start of String

^

Match beginning of input

End of String

$

Match end of input

Word Boundary

\b

Match position between word and non-word

Groups & Sets

Character Set

[abc]

Any character in the brackets

Negated Set

[^abc]

Any character NOT in the brackets

Capturing Group

(abc)

Group multiple tokens together

Non-Capturing Group

(?:abc)

Group without capturing

Interactive Testing

Want to test these patterns live? Head over to our Regex Tester to debug your regular expressions in real-time.