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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^[-+]?\d*$
Description
Matches any integer number or numeric string, including positive and negative value characters (+ or -). Also matches empty strings.
Matches
123 | -123 | +123
Non-Matches
abc | 3.14159 | -3.14159
Author Rating: Not yet rated. Steven Smith
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: Allow alpha chars
Name: Patricio
Date: 2/25/2011 12:56:59 PM
Comment:
This expression allows alpha chars in the first position like "a" or another char.


Title: Doesn't require a number
Name: Lindsay
Date: 9/13/2004 7:07:02 PM
Comment:
This regular expression allows '-' by itself. :(


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