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 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
(^\d*\.?\d*[0-9]+\d*$)|(^[0-9]+\d*\.\d*$)
Description
This matches all positive decimal values. There was one here already which claimed to but would fail on value 0.00 which is positive AFAIK...
Matches
0.00 | 1.23 | 4.56
Non-Matches
-1.03 | -0.01 | -0.00
Author Rating: The rating for this expression. Derek Noonan
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 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
^(\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
^(\$)?((\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 Short type
Expression
^(0|[-]{1}([1-9]{1}[0-9]{0,3}|[1-2]{1}[0-9]{1,4}|[3]{1}([0-1]{1}[0-9]{3}|[2]{1}([0-6]{1}[0-9]{2}|[7]{1}([0-5]{1}[0-9]{1}|([6]{1}[0-8]{1})))))|(\+)?([1-9]{1}[0-9]{0,3}|[1-2]{1}[0-9]{1,4}|[3]{1}([0-1]{1}[0-9]{3}|[2]{1}([0-6]{1}[0-9]{2}|[7]{1}([0-5]{1}[0-9]{1}|([6]{1}[0-7]{1}))))))$
Description
Short type, will match a short number from range -32768 to 32767.
Matches
-32768 | -10 | 0 | 10 | 32767
Non-Matches
+0 | -0 | -32769 | 32768
Author Rating: Not yet rated. João Batista Neto
Title Test Details Pattern Title
Expression
(^([0-9]+[.]+[0-9]+)|(0)$)
Description
Wrote this to accept either decimals or zero, but not whole numbers - for a particular project...
Matches
1.1 | 12.12 | 0
Non-Matches
. | .123 | 123.
Author Rating: Not yet rated. c raz
Title Test Details Pattern Title
Expression
^1000([.][0]{1,3})?$|^\d{1,3}$|^\d{1,3}([.]\d{1,3})$|^([.]\d{1,3})$
Description
allows positive none-to-3-decimal values between 0.000 and 1000.000
Matches
.123 | 0.126 | 1000.000
Non-Matches
.1234 | 0.1b6 | 1000.001
Author Rating: Not yet rated. gregg durishan
Title Test Details Pattern Title
Expression
^(\-)?1000([.][0]{1,3})?$|^(\-)?\d{1,3}$|^(\-)?\d{1,3}([.]\d{1,3})$|^(\-)?([.]\d{1,3})$
Description
allows positive and negative none-to-3-decimal values between -1000.000 and 1000.000
Matches
123.456 | -0.125 | -1000.000
Non-Matches
123.4567 | -0.1b5 | -1000.001
Author Rating: Not yet rated. gregg durishan
Title Test Details Unsigned Byte type
Expression
(0|(\+)?([1-9]{1}[0-9]{0,1}|[1]{1}[0-9]{0,2}|[2]{1}([0-4]{1}[0-9]{1}|[5]{1}[0-5]{1})))
Description
Will match an unsigned byte, from range 0 to 255
Matches
0 | 10 | 127 | 255
Non-Matches
-10 | -1 | +0 | -0 | 256
Author Rating: Not yet rated. João Batista Neto
Title Test Details Byte type
Expression
^(0|[-]{1}([1-9]{1}[0-9]{0,1}|[1]{1}([0-1]{1}[0-9]{1}|[2]{1}[0-8]{1}))|(\+)?([1-9]{1}[0-9]{0,1}|[1]{1}([0-1]{1}[0-9]{1}|[2]{1}[0-7]{1})))$
Description
Not just a number, a byte type. Will match any number from range -128 to 127.
Matches
-128 | 127 | 0 | 1 | -10
Non-Matches
-129 | 128 | -0 | +0
Author Rating: Not yet rated. João Batista Neto
Title Test Details Pattern Title
Expression
^\d{1,8}$|^\d{1,3},\d{3}$|^\d{1,2},\d{3},\d{3}$
Description
Validates numeric input of 99,999,999 to 0 with or without commas. but no decimal places. Very simple, but not bad for a novice.
Matches
1000 | 12,345 | 12,345,678
Non-Matches
1.1 | 1,10 | 123,888,888
Author Rating: Not yet rated. Wayne Herndon
Title Test Details Unsigned Int type
Expression
^(0|(\+)?[1-9]{1}[0-9]{0,8}|(\+)?[1-3]{1}[0-9]{1,9}|(\+)?[4]{1}([0-1]{1}[0-9]{8}|[2]{1}([0-8]{1}[0-9]{7}|[9]{1}([0-3]{1}[0-9]{6}|[4]{1}([0-8]{1}[0-9]{5}|[9]{1}([0-5]{1}[0-9]{4}|[6]{1}([0-6]{1}[0-9]{3}|[7]{1}([0-1]{1}[0-9]{2}|[2]{1}([0-8]{1}[0-9]{1}|[9]{1}[0-5]{1})))))))))$
Description
Will match any unsigned integer from range 0 to 4294967295
Matches
0 | 1000 | 4294967295
Non-Matches
-100 | -0 | +0 | 4294967296
Author Rating: Not yet rated. João Batista Neto
Title Test Details Pattern Title
Expression
^[-+]?\d+(\.\d+)?|[-+]?\.\d+?$
Description
Matches
100.00 | +100.00 | -100.00
Non-Matches
abc
Author Rating: Not yet rated. Donald Schneider
Title Test Details Pattern Title
Expression
^([0-9]*\,?[0-9]+|[0-9]+\,?[0-9]*)?$
Description
Integer numbers with decimals. Only positives match. This expression doesn't match numbers with group separators
Matches
1234,50 | 0,70 | ,03
Non-Matches
1.234,50 | -234,50
Author Rating: Not yet rated. Homero Fonseca
Title Test Details Unsigned Short Type
Expression
^(0|(\+)?([1-9]{1}[0-9]{0,3})|([1-5]{1}[0-9]{1,4}|[6]{1}([0-4]{1}[0-9]{3}|[5]{1}([0-4]{1}[0-9]{2}|[5]{1}([0-2]{1}[0-9]{1}|[3]{1}[0-5]{1})))))$
Description
Will match an unsigned short number from range 0 to 65535
Matches
0 | 100 | 65535
Non-Matches
-0 | +0 | -10 | 65536
Author Rating: Not yet rated. João Batista Neto
Title Test Details Pattern Title
Expression
^([1-9]{1}[0-9]{0,7})+((,[1-9]{1}[0-9]{0,7}){0,1})+$
Description
Validate a comma delimited string of integer between 1 and 99999999 (change {0,7} to whatever you need). No zero leading.
Matches
1,2,3455,12345678 | 23045,34678,2892 | 1,2,99999999
Non-Matches
01,234,567 | 123,0445,3434, | 121,,1212,,12,
Author Rating: Not yet rated. Ivan Rodriguez
Title Test Details Int type
Expression
(0|[1-9]{1}[0-9]{0,8}|[1]{1}[0-9]{1,9}|[-]{1}[2]{1}([0]{1}[0-9]{8}|[1]{1}([0-3]{1}[0-9]{7}|[4]{1}([0-6]{1}[0-9]{6}|[7]{1}([0-3]{1}[0-9]{5}|[4]{1}([0-7]{1}[0-9]{4}|[8]{1}([0-2]{1}[0-9]{3}|[3]{1}([0-5]{1}[0-9]{2}|[6]{1}([0-3]{1}[0-9]{1}|[4]{1}[0-8]{1}))))))))|(\+)?[2]{1}([0]{1}[0-9]{8}|[1]{1}([0-3]{1}[0-9]{7}|[4]{1}([0-6]{1}[0-9]{6}|[7]{1}([0-3]{1}[0-9]{5}|[4]{1}([0-7]{1}[0-9]{4}|[8]{1}([0-2]{1}[0-9]{3}|[3]{1}([0-5]{1}[0-9]{2}|[6]{1}([0-3]{1}[0-9]{1}|[4]{1}[0-7]{1})))))))))
Description
Will match any integer from range -2147483648 to 2147483647.
Matches
-2147483648 | -100 | 0 | 100 | 2147483647
Non-Matches
-2147483649 | -0 | +0 | 2147483648
Author Rating: Not yet rated. João Batista Neto
Title Test Details Pattern Title
Expression
(^N/A$)|(^[-]?(\d+)(\.\d{0,3})?$)|(^[-]?(\d{1,3},(\d{3},)*\d{3}(\.\d{1,3})?|\d{1,3}(\.\d{1,3})?)$)
Description
This pattern matches a decimal value with up to 3 digits after the decimal. Comma is allowed as a thousands separator but not required. N/A is also allowed.
Matches
405.234 | 50 | 213123.456 | -1 | N/A
Non-Matches
bathreader | this is N/A | 3.14159 | +10
Author Rating: Not yet rated. Jon Galloway
Change page:   |    Displaying page 2 of 6 pages; Items 21 to 40

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