Regular Expressions 101

Community Patterns

Currency amount without currency symbol

2

Regular Expression
PCRE (PHP <7.3)

/
(-?\d{1,3}(,?\d{3})*(\.\d{2}?))(\D|$)
/

Description

Matches numbers that are likely to by financial amount. Does not consider the type of currency.

Submitted by elgehelge - 9 years ago