Regular Expression To Get All Numbers From A String

Category: Numbers

A regular expression to match all numbers found within a string.

/(\d+)/g

Matches:

  • RegexPattern123
  • 123RegexPattern
  • 123

Non-matches:

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.