107 regular expressions found in this category!
Displaying page
of
pages;
Items to
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:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?!\u00a2) #Don't allow cent symbol
\p{Sc}? #optional unicode currency symbols
(?!0,?\d) #don't allow leading zero if 1 or more unit
(?:\d{1,3} # 1 to 3 digits
(?:([, .])\d{3})? # if there is a separator it must be followed by 3 digits
(?:\1\d{3})* # if the is more than two groups the same separtor must but used, it must be followed by 3 digits
|(?:\d+)) # more than 3 digit with no comma separator
((?!\1)[,.]\d{2})?$ # option cents |
Description |
Internationally capable currency formats. It is NOT local aware. Should be modify for local specific validations.
More detail at http://blogs.regexadvice.com/mash/archive/2004/06/08/1246.aspx |
Matches |
$9,876,543.21 | €9 876 543,21 | €9.876.543,21 |
Non-Matches |
9.876.543.21 | 9,876,543,21 | 9 876 543 21 |
Author |
Rating:
Michael Ash
|
Title |
Test
Details
Pattern Title
|
Expression |
^\$?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$ |
Description |
Many currency expresssions allow leading zeros, thus $01.40 passes thru them. This expression kills them, except for 0 in the one's column. Works with or without commas and/or dollar sign. Decimals not mandatory, unless no zero in ones column and decimal point is placed. Allows $0.00 and .0 Keywords: money dollar currency |
Matches |
$1,234.50 | $0.70 | .7 |
Non-Matches |
$0,123.50 | $00.5 |
Author |
Rating:
Tom Persing
|
Title |
Test
Details
Pattern Title
|
Expression |
(^\d*\.?\d*[1-9]+\d*$)|(^[1-9]+\d*\.\d*$) |
Description |
Accepts only positive decimal values. Zero and negatvie numbers are non-matching. Allows zeros after last non-zero numeric value after decimal place for significant digits. |
Matches |
0.050 | 5.0000 | 5000 |
Non-Matches |
0 | 0.0 | .0 |
Author |
Rating:
Bri Gipson
|
Title |
Test
Details
Pattern Title
|
Expression |
^(\d{1,3}'(\d{3}')*\d{3}(\.\d{1,3})?|\d{1,3}(\.\d{3})?)$ |
Description |
This regex match numeric data in the following format: thousands are separated by (') apostrophe, decimal places are separated by dot (.) Maximum three decimal places are not required. It's easy to change to other separators as well. |
Matches |
1'235.140 | 1'222'333.120 | 456 |
Non-Matches |
1234.500 | 78'45.123 | 123,0012 |
Author |
Rating:
Dalibor Kalna
|
Title |
Test
Details
Pattern Title
|
Expression |
^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(\.[0-9][0-9])?$ |
Description |
Matches US currency input with or without commas. This provides a fix for the currency regular expression posted at http://regxlib.com/REDetails.aspx?regexp_id=70 by escaping the . (period) to ensure that no other characters may be used in it's place. |
Matches |
$3,023,123.34 | 9,876,453 | 123456.78 |
Non-Matches |
4,33,234.34 | $1.234 | abc |
Author |
Rating:
Al Kahler
|
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:
T H
|
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
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:
João Batista Neto
|
Title |
Test
Details
Pattern Title
|
Expression |
^[1-9]+[0-9]*$ |
Description |
Allows only positive integers that are greater then 0. Easily modified for +/- intergers and allowing zero. |
Matches |
1 | 12 | 124 |
Non-Matches |
-1 | a | 1.0 |
Author |
Rating:
William Powell
|
Title |
Test
Details
Pattern Title
|
Expression |
^\d{0,2}(\.\d{1,2})?$ |
Description |
This regular expression validates that the data entered is a number with a maximum of two integers and two decimals and a minimum of one integer or one decimal. |
Matches |
99.99 | 99 | .99 |
Non-Matches |
999.999 | 999 | .999 |
Author |
Rating:
Jaime Borges
|
Title |
Test
Details
Pattern Title
|
Expression |
^100$|^[0-9]{1,2}$|^[0-9]{1,2}\,[0-9]{1,3}$ |
Description |
Percentage with 3 number after comma. |
Matches |
12,654 | 1,987 |
Non-Matches |
128,2 | 12, |
Author |
Rating:
Samir AZZA
|
Title |
Test
Details
Pattern Title
|
Expression |
^(((\d{1,3})(,\d{3})*)|(\d+))(.\d+)?$ |
Description |
validates numbers, with or without decimal places, and comma 1000 separators. |
Matches |
9999999 | 99999.99999 | 99,999,999.9999 |
Non-Matches |
9999. | 9,99,99999.999 | 999.9999.9999 |
Author |
Rating:
Neville Clark
|
Title |
Test
Details
Pattern Title
|
Expression |
^[-+]?\d+(\.\d+)?$ |
Description |
This matches any real number, with optional decimal point and numbers after the decimal, and optional positive (+) or negative (-) designation. |
Matches |
123 | -123.45 | +123.56 |
Non-Matches |
123x | .123 | -123. |
Author |
Rating:
Steven Smith
|
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 |
^(\d|-)?(\d|,)*\.?\d*$ |
Description |
Input for Numeric values. Handles negatives, and comma formatted values. Also handles a single decimal point |
Matches |
5,000 | -5,000 | 100.044 |
Non-Matches |
abc | Hundred | 1.3.4 |
Author |
Rating:
Kevin Read
|
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:
Bob Levittan
|
Title |
Test
Details
Pattern Title
|
Expression |
^(\$|)([1-9]\d{0,2}(\,\d{3})*|([1-9]\d*))(\.\d{2})?$ |
Description |
Combine Michael Ash's US Dollar amount and Bri Gipson's eliminating zero input to create this RE to accept Optional leading dollar sign, optional well-formed comma separator dollar amount with no zero amount allowed.
*** Correction: Remove the "+" otherwise it will incorrectly matches 4 leading digits like 1234,345,678.00 03-03-2005
|
Matches |
$1,234,567.89 | 1234567.89 | $9.99 |
Non-Matches |
$1,2345,67.89 | $1234,345,678.0 | 0 |
Author |
Rating:
Joe Lynwood
|
Title |
Test
Details
Pattern Title
|
Expression |
^((\d?)|(([-+]?\d+\.?\d*)|([-+]?\d*\.?\d+))|(([-+]?\d+\.?\d*\,\ ?)*([-+]?\d+\.?\d*))|(([-+]?\d*\.?\d+\,\ ?)*([-+]?\d*\.?\d+))|(([-+]?\d+\.?\d*\,\ ?)*([-+]?\d*\.?\d+))|(([-+]?\d*\.?\d+\,\ ?)*([-+]?\d+\.?\d*)))$ |
Description |
This allows a sequence of real numbers to be added, separated by a comma (required) and a space (optional). Based pretty heavily on an expression by Steven Smith on this site. |
Matches |
8.0 | 8.0,-.38,+8.9 | 8.0, +8.8, 0.09 |
Non-Matches |
+ | . | a,b, c |
Author |
Rating:
Paul Auger
|
Displaying page
of
pages;
Items to