Regular Expressions 101

Community Patterns

1...45678...901

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