Regular Expressions 101

Community Library Entry

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 - 10 years ago