Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
ECMAScript (JavaScript)

/
^0*?[1-9]\d*$
/

Description

Accepts all positive numbers above 0. Accepts numbers with leading zeroes e.g.: 0123, 00123.

Submitted by Sandeep Ranka - 10 years ago