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{1,3})(,\d{3})*)|(\d+))(.\d+)?$
Description
validates numbers, with or without decimal places, and comma 1000 separators.
Matches
9999999 | 99999.99999 | 99,999,999.9999
Non-Matches
9999. | 9,99,99999.999 | 999.9999.9999
Author Rating: The rating for this expression. Neville Clark
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: Error en la Regex con el signo -
Name: pe.dominguez.br@gmail.com
Date: 6/9/2011 1:47:32 PM
Comment:
Sres, tengo un problema xq en regex si permite 45-45 por favor su apoyo para chequearlo


Title: Error en la Regex con el signo -
Name: pe.dominguez.br@gmail.com
Date: 6/9/2011 1:47:18 PM
Comment:
Sres, tengo un problema xq en regex si permite 45-45 por favor su apoyo para chequearlo


Title: wow, great, better than this simpler one of groups of 3 comma separated 1000s
Name: admin@qaweb.org
Date: 11/8/2010 3:35:02 PM
Comment:
finds integer of comma separated thousands anywhere in string (,{0,1}|[0-9]{1,3})+ no decimal at end but it could be copied from your example above


Title: Error in regex
Name: Patrick
Date: 5/3/2007 11:03:23 AM
Comment:
This regex does not work as it should. You are missing a '\' before the '.' Like this: ^(((\d{1,3})(,\d{3})*)|(\d+))(\.\d+)?$ Otherwise something like 100,000,0 will match.


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