107 regular expressions found in this category!
Displaying page
of
pages;
Items to
| Title |
Test
Details
Pattern Title
|
| Expression |
^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$ |
| Description |
Matches currency input with or without commas. |
| Matches |
$3,023,123.34 | 9,876,453 | 123456.78 |
| Non-Matches |
4,33,234.34 | $1.234 | abc |
| Author |
Rating:
Brian Orrell
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^[1]$|^[3]$|^[4]$|^[6]$|^[1]0$ |
| Description |
This will match single numbers,the first block [1346] checks for single digits of 1, 3, 4 or 6, could easily by [1-5] as well. The second block [10] checks for 10 only.
This matches inclusively. |
| Matches |
1 | 4 | 10 |
| Non-Matches |
13 | 2 | 0 |
| Author |
Rating:
Josh Crosby
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^(0*100{1,1}\.?((?<=\.)0*)?%?$)|(^0*\d{0,2}\.?((?<=\.)\d*)?%?)$ |
| Description |
Percentage (From 0 to 100) |
| Matches |
100% | 100 | 52.65% |
| Non-Matches |
-1 | -1% | 100.1% |
| Author |
Rating:
Andres Garcia
|
| 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:
Andrew van der Stock
|
| 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:
Harry Chou
|
| 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:
gregg durishan
|
| Title |
Test
Details
Pattern Title
|
| Expression |
(^(\+?\-? *[0-9]+)([,0-9 ]*)([0-9 ])*$)|(^ *$) |
| Description |
This is my basic phone number verification. it allows a + - , signs digits, spaces and blank entry |
| Matches |
+0335456 545 545 | -5465 545 | 5456465 5454,545 |
| Non-Matches |
fsd54df 54 |
| Author |
Rating:
Vitaly Kompot
|
| 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*$ |
| 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?[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 |
(?!^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]*\,?[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 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 |
^((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 |
^([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*\.?\d*$ |
| Description |
Matches any floating point numer/numeric string, including optional sign character (+ or -). Also matches empty strings. |
| Matches |
123 | +3.14159 | -3.14159 |
| Non-Matches |
abc | 3.4.5 | $99.95 |
| 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 |
^\d*$ |
| Description |
Accepts an unsigned integer number. Also matches empty strings. |
| Matches |
123 | 000 | 43 |
| Non-Matches |
asbc | -34 | 3.1415 |
| Author |
Rating:
Not yet rated.
Steven Smith
|
| 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 |
^(([+]\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
|
Displaying page
of
pages;
Items to