Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?!^\$0[1-9])(?=^(\$[0-9]+(\,[0-9]{3})*)+(\.[0-9]+)?$)^.{1,19}$|(?!^0[1-9])(?=^([0-9]+(\,[0-9]{3})*)+(\.[0-9]+)?$)^.{1,18}$
/

Description

Us Currency Format with Length Limitation optional(,)(.decimals)

Submitted by Renu Anil - 9 years ago