107 regular expressions found in this category!
Displaying page
of
pages;
Items to
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{1,3},?(\d{3},?)*\d{3}(\.\d{0,2})?|\d{1,3}(\.\d{0,2})?|\.\d{1,2}?)$ |
Description |
This expression will validate for US Currency with a wide range of input. Using other exps found on this site, I built this one to fix 2 main problems I was finding:
1-a space or blank entry is non-matching
2-use of .9 in place of .90 will match (this is for those people like me who hate to type and if I put .9 I mean .90
Hope this helps others save a little time. I feel I was pretty thorough in testing, but if you find something wrong, please post it. -Thanks |
Matches |
$1.99 | 1.99 | .99 |
Non-Matches |
$10.999 | 100,00.99 | blank |
Author |
Rating:
Not yet rated.
Kirk Fuller
|
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 |
^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 |
^((4\d{3})|(5[1-5]\d{2}))(-?|\040?)(\d{4}(-?|\040?)){3}|^(3[4,7]\d{2})(-?|\040?)\d{6}(-?|\040?)\d{5} |
Description |
Credit card validator for AMEX, VISA, MasterCard only. Allows spaces, dashes, or no separator between digit groups according to the layout (4-6-5 for AMEX, 4-4-4-4 for Visa and Mastercard) |
Matches |
3711-078176-01234 | 4123 5123 6123 7123 | 5123412361237123 |
Non-Matches |
3711-4123-5123-6112 |
Author |
Rating:
Not yet rated.
Rick Spiewak
|
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 |
^([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 |
^(([+]\d{2}[ ][1-9]\d{0,2}[ ])|([0]\d{1,3}[-]))((\d{2}([ ]\d{2}){2})|(\d{3}([ ]\d{3})*([ ]\d{2})+))$ |
Description |
Swedish phone numbers according to SIS standard |
Matches |
+46 8 123 456 78 | 08-123 456 78 | 0123-456 78 |
Non-Matches |
+46 08-123 456 78 | 08 123 456 78 | 0123 456 78 |
Author |
Rating:
Not yet rated.
Martin Henningsson
|
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]{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}\d*$|^\d*$ |
Description |
This expression is used to validate fractions (entered as strings). It will also accept non-fractional entries. Simple, but effective. |
Matches |
100 | 1 1/2 | 1232 5/8 |
Non-Matches |
a 1/2 | abc | a b/c |
Author |
Rating:
Not yet rated.
Kevin Hillabolt
|
Title |
Test
Details
Pattern Title
|
Expression |
^(\d|,)*\.?\d*$ |
Description |
Matches Numeric with Commas and a single decimal point. Also matches empty string. |
Matches |
1,000 | 3,000.05 | 5,000,000 |
Non-Matches |
abc | $100,000 | Forty |
Author |
Rating:
Not yet rated.
Kevin Read
|
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 |
^[+]?\d*$ |
Description |
This re was used for set numbers only!
Somente numeros são requeridos! |
Matches |
0123456789 | 1234 | 1 |
Non-Matches |
1.0?& | a1 | 2a- |
Author |
Rating:
Not yet rated.
Ramon Durães
|
Title |
Test
Details
Pattern Title
|
Expression |
^[12345]$ |
Description |
This matches a single numeric digit between 1 and 5, and is the same as saying ^[1-5]$. |
Matches |
1 | 2 | 4 |
Non-Matches |
6 | -1 | abc |
Author |
Rating:
Not yet rated.
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
(^-\d*\.?\d*[1-9]+\d*$)|(^-[1-9]+\d*\.\d*$) |
Description |
Accepts only negative decimal values. Zero and positive numbers are non-matching. Allows zeros after last non-zero numeric value after decimal place for significant digits. |
Matches |
-0.050 | -5.000 | -5 |
Non-Matches |
0 | 0.0 | .0 |
Author |
Rating:
Not yet rated.
Bri Gipson
|
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 |
^((\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 |
^[-+]?[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:
Not yet rated.
Chuck Scholton
|
Displaying page
of
pages;
Items to