Regular Expressions 101

Community Patterns

Community Library Entry

5

Regular Expression
PCRE (PHP <7.3)

/
^[^0|\D]\d{0,9}(\.\d{1,2})?$
/

Description

Pattern that only accept numeric value and greater than zero with up to decimal places�( you can change the decimal places just replace {1,2} depend on how many decimal places you like

Submitted by Eugene To - 9 years ago