107 regular expressions found in this category!
Displaying page
of
pages;
Items to
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 |
^\$?(\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 |
^([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{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
Pattern Title
|
Expression |
^\$[0-9]+(\.[0-9][0-9])?$ |
Description |
Validates a dollar amount including a dollar sign and 2 decmals. The decimal and cents are optional. |
Matches |
$1.50 | $49 | $0.50 |
Non-Matches |
1.5 | $1.333 | this $5.12 fails |
Author |
Rating:
Not yet rated.
Bob Levittan
|
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
|
Displaying page
of
pages;
Items to