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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^[-+]?[1-9]\d*\.?[0]*$
Description
This will check if a number is an integer. Positive integers are all the whole numbers greater than zero: 1, 2, 3, 4, 5, ... . Negative integers are all the opposites of whole numbers: -1, -2, -3,-4, -5, ... . Zero is not a whole number with either a positive or negative value, and is not an interger. Null or Empty values are not intergers.
Matches
10 | -10 | +10.00
Non-Matches
0 | -10.50 | 10.50
Author Rating: Not yet rated. Chuck Scholton
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: Zero is an integer: Provided link
Name: Mark
Date: 7/28/2006 7:34:09 PM
Comment:
This didn't make it through in the URL field: http://mathworld.wolfram.com/Integer.html


Title: 0 is an integer
Name: Mark
Date: 7/28/2006 7:33:19 PM
Comment:
0 is an integer. Check out the provided link.


Title: Now Corrected
Name: Chuck Scholton
Date: 8/27/2003 4:49:16 PM
Comment:
No Longer will match 200!00 patterns. There was missing a \ before the . in the regex. Retested and the current expression is updated.


Title: Not correct
Name: Hardy
Date: 8/27/2003 4:23:29 PM
Comment:
try to check "200!00", pattern says matching...


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