Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^(?!0*(\.0+)?$)(\d+|\d*\.\d+)$
/

Description

RegEx - Exclude zero

Submitted by http://stackoverflow.com/questions/8910972/regex-exclude-zero - 9 years ago