Regular Expression For Formatted Number With Space As Thousand Separator

Category: Numbers

A Regular Expression for those who use a space as thousands separator.

/(^(((\d)|(\d\d)|(\d\d\d))(\xA0|\x20))*((\d)|(\d\d)|(\d\d\d))([,.]\d*)?$)/

Matches:

  • 123 456
  • 123 456.78
  • 1 234

Non-matches:

  • 123456.78
  • 123,456.78
  • 1234

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.