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
^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
^\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: Not yet rated. Andrew van der Stock
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
^(\$)?((\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 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 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
^((\d{1,2})?([.][\d]{1,2})?){1}[%]{1}$
Description
for checking a value is between 99.99% and 00.00%
Matches
99.99% | 9% | .09%
Non-Matches
99 | 9.%
Author Rating: Not yet rated. Thomas Keegan
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 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{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 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 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
(^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
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 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 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) (?# ExplicitCapture - capture named groups only ) ^ -? (?# Optional sign ) ( \d{1,8}(\.\d{1,2})? (?# Decimal point and trailing digits optional ) | \d{0,8}(\.\d{1,2}) (?# Leading digits optional ) ) $
Description
This pattern matches a simple Decimal Literal. Leading digits limited to 8 and does not support commification.
Matches
-14 | -14.26 | -.26
Non-Matches
-14. | -14.263 | -
Author Rating: Not yet rated. Darren Neimke
Title Test Details Pattern Title
Expression
^\-?\(?([0-9]{0,3}(\,?[0-9]{3})*(\.?[0-9]*))\)?$
Description
Match a positive or negative decimal value with any precision and scale. Allows for left-padded zeroes, commas as group separator, negative sign (-) or parenthesis to indicate negative number.
Matches
0.123 | (1234.123) | -01,200
Non-Matches
2.3.123 | 1,23.45
Author Rating: Not yet rated. Rich Franzmeier
Title Test Details Pattern Title
Expression
^[-+]?[0-9]\d{0,2}(\.\d{1,2})?%?$
Description
Required and regular expression validator. For supporting -999.99 to +999.99 . Positive and Negative integer/ decimal validations. Percentage sign is also supported. Will not allow empty strings. Can increase/decrease the range as you need.
Matches
12.3 | 123 | -123.45
Non-Matches
- | 10.1234 | -1234
Author Rating: Not yet rated. Error Reporter
Change page:   |    Displaying page 2 of 6 pages; Items 21 to 40

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