Regex To Match One Digit Number

Category: Numbers

A regular expression that allows you to match all one-digit numbers in a string.

/\b\d\b/g

Matches:

  • Regex 4 Pattern
  • Regex 4 Pattern 5
  • Regex 3 4 Pattern 5

Non-matches:

  • Regex 34 Pattern
  • Regex Pattern 345
  • 345 Regex Pattern

See Also:

Rate This Regex
Sending
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.