107 regular expressions found in this category!
Displaying page
of
pages;
Items to
| Title |
Test
Details
Pattern Title
|
| Expression |
(\d{1,3},(\d{3},)*\d{3}(\.\d{1,3})?|\d{1,3}(\.\d{3})?)$ |
| Description |
Dollar Amount |
| Matches |
2&651.50 | 987.895 |
| Non-Matches |
25$%787* |
| Author |
Rating:
Not yet rated.
Snikwad Kcirtap
|
| 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 |
(?!^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 |
^([0-9]*|\d*\.\d{1}?\d*)$ |
| Description |
Accept only (0-9) integer and one decimal point(decimal point is also optional).After decimal point it accepts at least one numeric .This will be usefull in money related
fields or decimal fields. |
| Matches |
.568 | 8578 | 1234567.1234567 |
| Non-Matches |
568. | 56.89.36 | 5.3.6.9.6 |
| Author |
Rating:
Not yet rated.
sanjayanthan vijayakeerthi
|
| 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{1,7}$ |
| Description |
Positive Whole number matched from 0 to 9999999. Only 7 digits length is allowed. |
| Matches |
1234567 | 9999999 | 1 |
| Non-Matches |
12345678 | 9999.99 | -1234 |
| Author |
Rating:
Not yet rated.
Prashant Nayak
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^\d*\.?\d*$ |
| Description |
Matches any unsigned floating point number/numeric string. Also matches empty strings. |
| Matches |
123 | 3.14159 | .234 |
| Non-Matches |
abc | -3.14159 | 3.4.2 |
| Author |
Rating:
Not yet rated.
Steven Smith
|
| 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 |
(?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(\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-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 |
(^\$(\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 |
^([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 |
^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 |
(^[0-9]{1,8}|(^[0-9]{1,8}\.{0,1}[0-9]{1,2}))$ |
| Description |
Matches number in format XX.XX Please note that this expression allows maximum of 8 digits before the dot and 2 (optional) digits after the dot. |
| Matches |
1.00 | 2345 | 332.3 |
| Non-Matches |
.00 | 23333333333.00 | j22.00 |
| Author |
Rating:
Not yet rated.
Danil Sholokhov
|
| 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 |
(^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 |
^((\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
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 |
(?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
|
Displaying page
of
pages;
Items to