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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Price
Expression
\d[\d\,\.]+
Description
This regex will match any price, what so ever, if it's uses a comma as a 1000 seperator, or a dot, and if it uses comma as a decimal seperator or a dot, or if it do not use any seperator what so ever.
Matches
123.00
Non-Matches
1 123123
Author Rating: The rating for this expression. sirpadk
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: RegEx for Price with Comma and Dot Digit
Name: [email protected]
Date: 6/23/2009 3:54:21 AM
Comment:
RegEx for Price with Comma and Dot Digit.<br /> RegEx for Price pattern like this below<br /> <br /> ([[1-9]{1,3}\,]?)(\d{3}[\,]?)+(\.\d{1,4})?<br /> <br /> Note: Support 4 dot(.) digits and many comma(,) that no begin with zero(0). <br /> Assume x = 0-9<br /> Match: xxx,xxx,xxx.xxxx<br /> Match Ex: xx9,012,345,678.9<br /> Match Ex: xx9,012,345,678.90<br /> Match Ex: xx9,012,345,678.901<br /> Match Ex: xx9,012,345,678.9010<br /> No-Match: xxxxxxxxxxxxx<br /> No-Match Ex: 12345678901234567890<br /> No-Match Ex2: 0xx9,0012,3x45,678.9001x<br />


Title: RegEx for Price with Comma and Dot Digit
Name: [email protected]
Date: 6/23/2009 3:53:58 AM
Comment:
RegEx for Price with Comma and Dot Digit.<br /> RegEx for Price pattern like this below<br /> <br /> ([[1-9]{1,3}\,]?)(\d{3}[\,]?)+(\.\d{1,4})?<br /> <br /> Note: Support 4 dot(.) digits and many comma(,) that no begin with zero(0). <br /> Assume x = 0-9<br /> Match: xxx,xxx,xxx.xxxx<br /> Match Ex: xx9,012,345,678.9<br /> Match Ex: xx9,012,345,678.90<br /> Match Ex: xx9,012,345,678.901<br /> Match Ex: xx9,012,345,678.9010<br /> No-Match: xxxxxxxxxxxxx<br /> No-Match Ex: 12345678901234567890<br /> No-Match Ex2: 0xx9,0012,3x45,678.9001x<br />


Title: RegEx for Price with Comma and Dot Digit
Name: [email protected]
Date: 6/23/2009 3:49:54 AM
Comment:
RegEx for Price with Comma and Dot Digit. RegEx for Price pattern like this below ([[1-9]{1,3}\,]?)(\d{3}[\,]?)+(\.\d{1,4})? Note: Support 4 dot(.) digits and many comma(,) that no begin with zero(0). Assume x = 0-9 Match: xxx,xxx,xxx.xxxx Match Ex: xx9,012,345,678.9 Match Ex: xx9,012,345,678.90 Match Ex: xx9,012,345,678.901 Match Ex: xx9,012,345,678.9010 No-Match: xxxxxxxxxxxxx No-Match Ex: 12345678901234567890 No-Match Ex2: 0xx9,0012,3x45,678.9001x


Title: a real price validation regex / function
Name: Soldair
Date: 11/25/2008 12:38:17 AM
Comment:
here is my price validation javascript function. isPrice = function (numStr){ numStr = numStr+''; matches = numStr.match(/\$?[1-9]{1}[0-9]{0,3}(\.[0-9]{2})?/g); for(i in matches){ if(matches[i] == numStr){ return true; } } return false; } this function will match any price less then 9999.99 dollars as i have imposed a 4 digit limit to the first section of the price. the value 1.0 is not considered a valid price as it is standard in america to include both digits for cents or not at all


Title: Not strict enough
Name: Michael Ash
Date: 11/7/2006 10:39:45 AM
Comment:
Will match 1,,,,,, or 0......... or 12345,6789


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