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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find IsNumeric
Expression
^(?:(?:[+\-]?\$?)|(?:\$?[+\-]?))?(?:(?:\d{1,3}(?:(?:,\d{3})|(?:\d))*(?:\.(?:\d*|\d+[eE][+\-]\d+))?)|(?:\.\d+(?:[eE][+\-]\d+)?))$
Description
This regex will validate the given string is numeric
Matches
$123.1234 | .123 | .123e+01
Non-Matches
asdf | , | 1,1 | .
Author Rating: The rating for this expression. Mitch Freed
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: i tried it and it works
Name: WL
Date: 9/4/2007 2:53:06 AM
Comment:
what makes it not work?


Title: Is Numeric regex
Name: JR
Date: 8/9/2007 10:17:01 AM
Comment:
I tried your expression and it is not a valid one. At least that's what my compiler says.


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