Regex Cheatsheet - Regular Expression Quick Reference

Quick reference for regular expression patterns. Character classes, quantifiers, anchors, and common patterns.

Share
Back to Regex Cheatsheet

Digit Shorthand \d

Character Class

Matches any digit, equivalent to [0-9]

Pattern

\d

Syntax

Explanation

\d is a predefined character class matching a single digit. \d+ matches one or more digits.

Examples

\d{3}

Matches exactly 3 digits

Matches: 123, 456

\d+

Matches one or more digits

Matches: 12345

Related Tools

More Text Tools