Regex \d — Match a Digit
\d matches a single digit [0-9]. In Unicode mode (JS /u or Python re.UNICODE) it expands to all Unicode Nd (Decimal_Number) characters. Example: /\d/ on "abc123" matches 1, 2, 3.
Open the interactive DevRef Hub tool →Key facts
| Token | \d |
|---|---|
| ASCII match | [0-9] |
| Unicode mode | Nd (Decimal_Number) |
| Example | /\d/ → "1","2","3" |
Frequently asked questions
What does \d match?
A single digit, [0-9] in ASCII mode.
Does \d match Unicode digits?
Yes, in Unicode mode it covers all Nd characters.
Related pages
Regex \d — Digit is part of DevRef Hub on GOAT Lab — a free reference you can use without signing up, and it works offline. Open the tool above for any custom value.
Part of GOAT Lab — 26 free, browser-based science, engineering and developer tools. No sign-up.