Loading…

How to use Regex Cheatsheet

Browse regex building blocks by category and try any pattern in the live tester against your own text to see exactly what it matches before using it in code.

Frequently asked questions

What does \d match?

\d matches any digit 0-9. Its opposite \D matches any non-digit, and similar shorthands exist for word (\w) and whitespace (\s) characters.

What is the difference between * and +?

* matches zero or more of the preceding token, while + requires at least one, so a+ needs one or more 'a' characters.

What are anchors ^ and $?

^ asserts the start of the string or line and $ the end, letting you match patterns only at those boundaries.

More Developer Tools

HTTP Headers Ref
Common request/response headers.
Color Names Ref
CSS named colors palette.
Lorem Ipsum Advanced
Words/sentences/paragraphs generator.
Hash Generator Advanced
MD5/SHA1/SHA256/SHA512 side-by-side.
Color Gradient CSS
Linear/radial/conic gradient generator.
Box Shadow Generator
Live CSS box-shadow preview.
Text Shadow Generator
Live CSS text-shadow preview.
Border Radius Generator
Independent corner radius controls.
Flexbox Generator
Visual flex layout + CSS code.
Grid Generator
Visual grid layout + CSS code.
Animation Generator
Generate keyframes with preview.
Meta Tags Advanced
SEO + OG + Twitter meta generator.

← View all Developer ToolsBrowse all 1,100+ tools →