Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(\d{1,})(\,)?\d{1,2}$
/
g

Description

should accept all digits with a comma with or without decimals. If there is a comma, there should be decimals cannot start with comma

Submitted by Derek Vonk - 8 years ago