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|-)?(\d|,)*\.?\d*$
Description
Input for Numeric values. Handles negatives, and comma formatted values. Also handles a single decimal point
Matches
5,000 | -5,000 | 100.044
Non-Matches
abc | Hundred | 1.3.4
Author Rating: Not yet rated. Kevin Read
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: Doesn't work
Name: John
Date: 7/29/2006 11:37:12 PM
Comment:
12.12345 aaa.1234 -234.12345678 123456 try this data set. It will only match the "123456".


Title: missing
Name: ron
Date: 6/17/2004 4:57:51 AM
Comment:
does not handle this: 035.555580555555555555 leading zero should not be acceptable


Title: Comma Formatting
Name: Jon S.
Date: 4/21/2004 2:26:20 PM
Comment:
This regexp doesn't enforce correctly formatted comma values. For example, the following values pass: 1,2,3,4,5 ,,1,,2,,


Title: ISS
Name: Bart
Date: 1/29/2004 10:38:12 AM
Comment:
Thank you for the expression. It worked perfectly and it saved me many hours. Great Job!


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