Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^[+-]?((0\.\d+)|([1-9]+(\d?\.\d+)?))$
/

Description

Optional plus or minus sign. Leading zero required for decimal number less than zero.

Submitted by Mario Diana - 10 years ago