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*[0-9](|.\d*[0-9]|,\d*[0-9])?$
Description
This is permit all decimal number, exclude all alphanumeric caracter
Matches
123456.123456 | 123456,123456 | 123456
Non-Matches
123a.123 | 123a,123 | a
Author Rating: Not yet rated. Hugues Gauthier
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: Correction
Name: Paul Wilkins
Date: 8/12/2008 10:46:00 PM
Comment:
The fullstop needs to be escaped, otherwise it will accept any separator between the numbers. Before: ^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$ 5@9 passes After: 5@9 fails ^\d*[0-9](\.\d*[0-9]|,\d*[0-9])?$


Title: Errors
Name: María
Date: 7/14/2006 8:45:59 AM
Comment:
The test passes '111-999', or '99p00', even with the modifications.


Title: Good Work
Name: Ritesh P
Date: 7/5/2005 1:19:44 AM
Comment:
Good one and thanx to Andy and Ben


Title: error (and fix)
Name: Ben Kreger
Date: 7/16/2004 12:59:25 PM
Comment:
doesn't accept .9 (no leading 0 before the decimal point) fix (with Andy's negative fix included as well): ^-?\d*[0-9]?(|.\d*[0-9]|,\d*[0-9])?$


Title: Good one.
Name: Sudharsan
Date: 5/20/2004 6:50:29 AM
Comment:
Good one.


Title: Error Found
Name: Sai Krishna
Date: 4/8/2003 2:03:19 AM
Comment:
The test passes for '49r00'. Which i suppose is wrong


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