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

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 55 regular expressions found.

Change page:   |    Displaying page 1 of 3 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$
Description
Matches currency input with or without commas.
Matches
$3,023,123.34 | 9,876,453 | 123456.78
Non-Matches
4,33,234.34 | $1.234 | abc
Author Rating: The rating for this expression. Brian Orrell
Title Test Details US currency
Expression
^\$(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$
Description
This re matches US currency format with lead dollar sign. Dollar value must have at least one digit and may or may not be comma separated. Cents value is optional.
Matches
$0.84 | $123458 | $1,234,567.89
Non-Matches
$12,3456.01 | 12345 | $1.234
Author Rating: The rating for this expression. Michael Ash
Title Test Details Pattern Title
Expression
^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(\.[0-9][0-9])?$
Description
Matches US currency input with or without commas. This provides a fix for the currency regular expression posted at http://regxlib.com/REDetails.aspx?regexp_id=70 by escaping the . (period) to ensure that no other characters may be used in it's place.
Matches
$3,023,123.34 | 9,876,453 | 123456.78
Non-Matches
4,33,234.34 | $1.234 | abc
Author Rating: The rating for this expression. Al Kahler
Title Test Details Pattern Title
Expression
^\$?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{0,2})?$
Description
From Author: DON'T USE THIS ONE. FIND MY OTHER ONE THAT BLOCKS LEADING ZEROS. My site also couldn't swallow the \d, so I switched to numeric ranges and it worked fine. KEYWORDS Currency Money Dollar
Matches
$0,234.50 | 0234.5 | 0,234.
Non-Matches
$1,23,50 | $123.123
Author Rating: Not yet rated. Tom Persing
Title Test Details Pattern Title
Expression
^\$?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$
Description
Many currency expresssions allow leading zeros, thus $01.40 passes thru them. This expression kills them, except for 0 in the one's column. Works with or without commas and/or dollar sign. Decimals not mandatory, unless no zero in ones column and decimal point is placed. Allows $0.00 and .0 Keywords: money dollar currency
Matches
$1,234.50 | $0.70 | .7
Non-Matches
$0,123.50 | $00.5
Author Rating: The rating for this expression. Tom Persing
Title Test Details Pattern Title
Expression
^\$?(\d{1,3},?(\d{3},?)*\d{3}(\.\d{1,3})?|\d{1,3}(\.\d{2})?)$
Description
Expression to handle US currency entry in .NET. Handy for regular expression validation controls where the user can be entering in a currancy value but you can't control explict entry values. Will accept a wide variety of values that can be easy cast to a double via the CDbl function. Expression is also compatible with default US string format for currency.
Matches
10000 | 10,000 | $1,000.00
Non-Matches
0.002 | x.0
Author Rating: Not yet rated. brent stineman
Title Test Details Pattern Title
Expression
^\$?(\d{1,3},?(\d{3},?)*\d{3}(\.\d{0,2})?|\d{1,3}(\.\d{0,2})?|\.\d{1,2}?)$
Description
This expression will validate for US Currency with a wide range of input. Using other exps found on this site, I built this one to fix 2 main problems I was finding: 1-a space or blank entry is non-matching 2-use of .9 in place of .90 will match (this is for those people like me who hate to type and if I put .9 I mean .90 Hope this helps others save a little time. I feel I was pretty thorough in testing, but if you find something wrong, please post it. -Thanks
Matches
$1.99 | 1.99 | .99
Non-Matches
$10.999 | 100,00.99 | blank
Author Rating: Not yet rated. Kirk Fuller
Title Test Details Pattern Title
Expression
^[-]?([1-9]{1}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|\.[0-9]{1,2})$
Description
This regular expression will match on a real / decimal / floating point / numeric string with no more than 2 digits past the decimal. The negative sign (-) is allowed. No leading zeroes or commas. It is based on a currency regular expression by Tom Persing.
Matches
123 | 123.54 | -.54
Non-Matches
123.543 | 0012 | 1,000.12
Author Rating: Not yet rated. T H
Title Test Details Pattern Title
Expression
^\d+(?:\.\d{0,2})?$
Description
Matches positive whole numbers with exactly zero or two decimal points if a . is present. Useful for checking currency amounts, such 5 or 5.00 or 5.25.
Matches
1 | 1.23 | 1234.45
Non-Matches
a1.34 | 1.23a | a
Author Rating: The rating for this expression. Andrew van der Stock
Title Test Details Pattern Title
Expression
(?n:(^\$?(?!0,?\d)\d{1,3}(?=(?<1>,)|(?<1>))(\k<1>\d{3})*(\.\d\d)?)$)
Description
Regular expression for validating a US currency string field. Matches an unlimited number of digits to the left of an optional decimal point. Digits to the left of the decimal point can optionally be formatted with commas, in standard US currency format. If the decimal point is present, it must be followed by exactly two digits to the right. Matches an optional preceding dollar sign. Uses regex lookahead to preclude leading zeros and to match the optional formatting comma.
Matches
$3,023,123.34 | 9,876 | 123456.78
Non-Matches
0.002 | $01.00 | ###1.00
Author Rating: Not yet rated. Jerry Schmersahl
Title Test Details Pattern Title
Expression
(^\$(\d{1,3},?(\d{3},?)*\d{3}(\.\d{1,3})?|\d{1,3}(\.\d{2})?)$|^\d{1,2}(\.\d{1,2})? *%$|^100%$)
Description
Matches either an explicitly input percentage or dollar amount, variety of formats of currency borrowed from another example on this board. This is useful when you want to prompt the user to specify either dollars or percent using only one field, and want to validate the entered text is one or the other.
Matches
$1000.00 | 100% | 50%
Non-Matches
%100 | .5% | 100
Author Rating: Not yet rated. Marc Ziss
Title Test Details Pattern Title
Expression
^(\$)?((\d+)|(\d{1,3})(\,\d{3})*)(\.\d{2,})?$
Description
This pattern handles currency including the following: optional period with two or more digits to the right of the period optional commas optional dollar sign($)
Matches
$3,333,333,333 | $333333 | $3,333.33
Non-Matches
3,33 | 3333,333,333 | 333.3
Author Rating: Not yet rated. Matt Wickless
Title Test Details Currency
Expression
^(?!\u00a2) #Don't allow cent symbol \p{Sc}? #optional unicode currency symbols (?!0,?\d) #don't allow leading zero if 1 or more unit (\d{1,3} # 1 to 3 digits (\,\d{3})* # if the is a comma it must be followed by 3 digits |(\d+)) # more than 3 digit with no comma separator (\.\d{2})?$ # option cents
Description
This regex validates Currency. The base monetary unit (ex. US dollar) followed by option two digit cent denomination. Base unit can't have leading zero. Comma's are optional on base units. Note: Your regex engine must support the \p character class to use this. For example this will work in .net but not javascript which doesn't support \p Also the &#162; is removed from the match by force. Any other cent symbol would need to be added to the exclude to not match.
Matches
$1,501.13 | &#163;215 | €4.93
Non-Matches
01.00 | $.00 | &#162;50
Author Rating: The rating for this expression. Michael Ash
Title Test Details Pattern Title
Expression
^\$?\-?([1-9]{1}[0-9]{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))$|^\-?\$?([1-9]{1}\d{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))$|^\(\$?([1-9]{1}\d{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))\)$
Description
currency format that allows optional $, optional &quot;-&quot;(MinusSignNegative) OR &quot;()&quot; (ParenNegative) but not both, optional cents, and optional commas separating thousands. Minus sign can be before or after $, but parens must be outside the $. UPDATED: now fails to match a &quot;$&quot; without any further numbers
Matches
($4,000.00) | -$4000.00 | -$400.00
Non-Matches
4,00.000 | abc | $
Author Rating: The rating for this expression. gregg durishan
Title Test Details Pattern Title
Expression
^(?!\u00a2) #Don't allow cent symbol \p{Sc}? #optional unicode currency symbols (?!0,?\d) #don't allow leading zero if 1 or more unit (?:\d{1,3} # 1 to 3 digits (?:([, .])\d{3})? # if there is a separator it must be followed by 3 digits (?:\1\d{3})* # if the is more than two groups the same separtor must but used, it must be followed by 3 digits |(?:\d+)) # more than 3 digit with no comma separator ((?!\1)[,.]\d{2})?$ # option cents
Description
Internationally capable currency formats. It is NOT local aware. Should be modify for local specific validations. More detail at http://blogs.regexadvice.com/mash/archive/2004/06/08/1246.aspx
Matches
$9,876,543.21 | €9 876 543,21 | €9.876.543,21
Non-Matches
9.876.543.21 | 9,876,543,21 | 9 876 543 21
Author Rating: Not yet rated. Michael Ash
Title Test Details Pattern Title
Expression
(^\d{1,5}$|^\d{1,5}\.\d{1,2}$)
Description
This expression evaluates simple currency values... alteast 1 digit and max 5 digits and if period then atleast one digit after period and max two digits after period
Matches
0 | 00000 | 00.00
Non-Matches
asds | 000000 | 00000.
Author Rating: The rating for this expression. Pankaj Bhasin
Title Test Details Pattern Title
Expression
^\s*-?((\d{1,3}(\.(\d){3})*)|\d*)(,\d{1,2})?\s?(\u20AC)?\s*$
Description
Matches euro currency (portuguese regional options). Uses the dot sign as the thousands separator (optional) and the comma sign as the decimal separator. Matches only 2 digitals after decimal. Also matches negative numbers.
Matches
-123123,12 € | 12312432134 | -12.234.123,23
Non-Matches
1234.12,234
Author Rating: The rating for this expression. Paulo Cunha
Title Test Details Pattern Title
Expression
^(?!0,?\d)([0-9]{2}[0-9]{0,}(\.[0-9]{2}))$
Description
Validates currency, must have two leading and two digits following a decimal point. Does not accept leading zero's.
Matches
10.00 | 32.50
Non-Matches
01.00 | 12 | 12.0
Author Rating: The rating for this expression. Boydlee Pollentine
Title Test Details Currency
Expression
^\$( )*\d*(.\d{1,2})?$
Description
Validates US currency but allows for spaces between the dollar sign and dollar amount. If there is cents the period validates to two decimal places
Matches
$100.00 | $100 | $10.25
Non-Matches
100. | $10.233 | $10.
Author Rating: Not yet rated. Vincent Faller
Title Test Details Pattern Title
Expression
(^\d*\.\d{2}$)
Description
If you need a textbox to allow only positive numbers with two decimal places, try this. I wanted the user to be able to enter any type of currency amount (US of course) but also have two decimal places for database field.
Matches
12.56 | 0.25 | 156.56
Non-Matches
-123.45 | 1.023 | 1.2
Author Rating: Not yet rated. Happy Jack
Change page:   |    Displaying page 1 of 3 pages; Items 1 to 20

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