RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find non zero positive integer
Expression
^(0+[1-9]|[1-9])[0-9]*$
Description
used to validate form fields values for positive integer values greater than 0 without explicitly checking if the input form value is greater than 0
Matches
122, 9992, 000022
Non-Matches
0, 00000, 1.2, -3.22
Author Rating: The rating for this expression. Anurag
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Can be simplified
Name: ngokli
Date: 12/2/2016 7:16:18 AM
Comment:
Isn't this equivalent to ^0*[1-9][0-9]*$ ?


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials