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

Please support RegExLib Sponsors

Sponsors

Browse Expressions by Category

107 regular expressions found in this category!

Expressions in category: Numbers

Change page:   |    Displaying page 2 of 6 pages; Items 21 to 40
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 "-"(MinusSignNegative) OR "()" (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 "$" 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
([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)|([0-9]+)
Description
This is just a very simple matcher for real numbers.
Matches
123.456 | .123 | 123
Non-Matches
. | apple | pear
Author Rating: The rating for this expression. Paul DeMarco
Title Test Details Pattern Title
Expression
^-?\d*(\.\d+)?$
Description
Matches all positive & negative decimal floating point numbers, to any magnitude. Allows empty string.
Matches
4.4 | .4 | -.4
Non-Matches
. | ... | zero
Author Rating: The rating for this expression. Murray Roke
Title Test Details Positive Integer
Expression
^\d+$
Description
Positive integer value.
Matches
123 | 10 | 54
Non-Matches
-54 | 54.234 | abc
Author Rating: The rating for this expression. Steven Smith
Title Test Details Pattern Title
Expression
^0$|^[1-9][0-9]*$|^[1-9][0-9]{0,2}(,[0-9]{3})$
Description
I need a pattern to match the whole number / integer (0-99999...), but also allow users to put comma in the thousand positions. This is what I got.
Matches
1234 | 0 | 12,345
Non-Matches
12,3245 | -1 | 1234.23
Author Rating: The rating for this expression. Harry Chou
Title Test Details Pattern Title
Expression
^[0-9]*(\.)?[0-9]+$
Description
it will check for the +ve decimal numbers
Matches
1 | 123 | 132.132
Non-Matches
1.2.2 | -123
Author Rating: The rating for this expression. himraj love
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: The rating for this expression. T H
Title Test Details Pattern Title
Expression
^(\d|,)*\d*$
Description
matches 0 and all positive integers only. will accept comma formatting only.
Matches
1234 | 1,234 | 1,234,567
Non-Matches
1234.0 | -1234 | $1234
Author Rating: The rating for this expression. Donald Schneider
Title Test Details Pattern Title
Expression
^[-+]?[1-9]\d*\.?[0]*$
Description
This will check if a number is an integer. Positive integers are all the whole numbers greater than zero: 1, 2, 3, 4, 5, ... . Negative integers are all the opposites of whole numbers: -1, -2, -3,-4, -5, ... . Zero is not a whole number with either a positive or negative value, and is not an interger. Null or Empty values are not intergers.
Matches
10 | -10 | +10.00
Non-Matches
0 | -10.50 | 10.50
Author Rating: The rating for this expression. Chuck Scholton
Title Test Details Pattern Title
Expression
^[-+]?\d*\.?\d*$
Description
Matches any floating point numer/numeric string, including optional sign character (+ or -). Also matches empty strings.
Matches
123 | +3.14159 | -3.14159
Non-Matches
abc | 3.4.5 | $99.95
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^\d*\.?((25)|(50)|(5)|(75)|(0)|(00))?$
Description
This is a pattern to search and verify that a decimal number ends with a 25, 50, 75, 0 or 00. It does match for a nothing after decimal also but I guess thats ok !!
Matches
0.25 | .75 | 123.50
Non-Matches
.77 | 1.435
Author Rating: Not yet rated. narsi v
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: Not yet rated. Al Kahler
Title Test Details Pattern Title
Expression
^\$?\d+(\.(\d{2}))?$
Description
To evaluate an amount with or without a dollar sign where the cents are optional.
Matches
$2.43 | 2.02 | $2112
Non-Matches
2.1 | $.14 | $2,222.12
Author Rating: Not yet rated. Daniel Repaci
Title Test Details Pattern Title
Expression
^(\d{1,3}'(\d{3}')*\d{3}(\.\d{1,3})?|\d{1,3}(\.\d{3})?)$
Description
This regex match numeric data in the following format: thousands are separated by (') apostrophe, decimal places are separated by dot (.) Maximum three decimal places are not required. It's easy to change to other separators as well.
Matches
1'235.140 | 1'222'333.120 | 456
Non-Matches
1234.500 | 78'45.123 | 123,0012
Author Rating: Not yet rated. Dalibor Kalna
Title Test Details Pattern Title
Expression
^[1]$|^[3]$|^[4]$|^[6]$|^[1]0$
Description
This will match single numbers,the first block [1346] checks for single digits of 1, 3, 4 or 6, could easily by [1-5] as well. The second block [10] checks for 10 only. This matches inclusively.
Matches
1 | 4 | 10
Non-Matches
13 | 2 | 0
Author Rating: Not yet rated. Josh Crosby
Title Test Details Pattern Title
Expression
^1?[1-9]$|^[1-2]0$
Description
Matches a whole number between 1 and 20 inclusively
Matches
1 | 11 | 20
Non-Matches
0 | 21
Author Rating: Not yet rated. Daniel Pickles
Title Test Details Pattern Title
Expression
^\d(\d)?(\d)?$
Description
Matches positive whole numbers from 0-999
Matches
0 | 12 | 876
Non-Matches
1000 | 1.23 | -234
Author Rating: Not yet rated.
Title Test Details Pattern Title
Expression
(?!^0*$)(?!^0*\.0*$)^\d{1,5}(\.\d{1,2})?$
Description
validates to 5 digits and 2 decimal places but not allowing zero
Matches
12345.12 | 0.5
Non-Matches
123456.12 | 1.234 | .1
Author Rating: Not yet rated. Paul Ashton
Title Test Details Pattern Title
Expression
^[-+]?\d+(\.\d+)?$
Description
This matches any real number, with optional decimal point and numbers after the decimal, and optional positive (+) or negative (-) designation.
Matches
123 | -123.45 | +123.56
Non-Matches
123x | .123 | -123.
Author Rating: Not yet rated. Steven Smith
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: Not yet rated. Tom Persing
Change page:   |    Displaying page 2 of 6 pages; Items 21 to 40

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