RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 42 regular expressions found.

   Displaying page 1 of 1 pages; Items 1 to 42
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*\.?((25)|(50)|(5)|(75)|(0)|(00))?$
Description
This is a pattern to search and verify that a decimal number ends with a 25, 50, 75, 0 or 00. It does match for a nothing after decimal also but I guess thats ok !!
Matches
0.25 | .75 | 123.50
Non-Matches
.77 | 1.435
Author Rating: Not yet rated. narsi v
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: Not yet rated. Dalibor Kalna
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: Not yet rated. Steven Smith
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: Not yet rated. Jaime Borges
Title Test Details Pattern Title
Expression
(?!^0*$)(?!^0*\.0*$)^\d{1,5}(\.\d{1,3})?$
Description
This regular expression validates a number NOT 0, with no more than 5 places ahead and 3 places behind the decimal point.
Matches
1 | 12345.123 | 0.5
Non-Matches
0 | 0.0 | 123456.1234
Author Rating: Not yet rated. Michael Trefry
Title Test Details Pattern Title
Expression
^[+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)([eE][+-]?[0-9]+)?$
Description
A regular expression that matches numbers. Integers or decimal numbers with or without the exponential form.
Matches
23 | -17.e23 | +.23e+2
Non-Matches
+.e2 | 23.17.5 | 10e2.0
Author Rating: The rating for this expression. Erik Pettersson
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: Not yet rated. Tom Persing
Title Test Details Pattern Title
Expression
^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$
Description
This is permit all decimal number, exclude all alphanumeric caracter
Matches
123456.123456 | 123456,123456 | 123456
Non-Matches
123a.123 | 123a,123 | a
Author Rating: Not yet rated. Hugues Gauthier
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: Not yet rated. Bri Gipson
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
^(\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
^\d{0,2}(\.\d{1,4})? *%?$
Description
An expression for .NET regular expression validation controls intended to faciliate the entry of percentage values both a whole numbers or as their decimal representations. Also compatible with the default US format for string formatting for percentages. Recommend that if you intended accept a value passing this express that you strip the percentage signs and take measures to ensure that any whole values are converted to percentages.
Matches
4.0% | 0.45 | .0345
Non-Matches
123 | %12
Author Rating: Not yet rated. brent stineman
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: Not yet rated. Kevin Read
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{1,5}(\.\d{1,2})?$
Description
validate a number 5 digits and 2 decimal places allowing zero
Matches
12345.67 | 0 | 0.1
Non-Matches
123456.78 | 123456.789 | .1
Author Rating: The rating for this expression. Paul Ashton
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-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+(?:\.\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: Not yet rated. Andrew van der Stock
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
^([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+))(.\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: The rating for this expression. Neville Clark
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
(^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
(^([0-9]+[.]+[0-9]+)|(0)$)
Description
Wrote this to accept either decimals or zero, but not whole numbers - for a particular project...
Matches
1.1 | 12.12 | 0
Non-Matches
. | .123 | 123.
Author Rating: Not yet rated. c raz
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
^(\-)?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: Not yet rated. gregg durishan
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
^( 100(?:\.0{1,2})? | 0*?\.\d{1,2} | \d{1,2}(?:\.\d{1,2})? )% $
Description
Matches a percentage between 0 and 100 (inclusive). Accepts up to 2 decimal places.
Matches
0% | 100% | .17%
Non-Matches
101% | -17 | 99.006%
Author Rating: Not yet rated. Darren Neimke
Title Test Details Pattern Title
Expression
(^\d{3,5}\,\d{2}$)|(^\d{3,5}$)
Description
Expression to validate values to fields Decimal 5,2 or 5 numbers. values &gt;=100,00 &lt;=99999,99 100,00=100 5000,00 = 5000
Matches
100,00 | 100 | 99999,99
Non-Matches
99,99 | 999999 | 1,00
Author Rating: The rating for this expression. Felipe Albacete
Title Test Details Pattern Title
Expression
^-?\d*(\.\d+)?$
Description
Matches all positive &amp; negative decimal floating point numbers, to any magnitude. Allows empty string.
Matches
4.4 | .4 | -.4
Non-Matches
. | ... | zero
Author Rating: The rating for this expression. Murray Roke
Title Test Details Pattern Title
Expression
^\-?\(?([0-9]{0,3}(\,?[0-9]{3})*(\.?[0-9]*))\)?$
Description
Match a positive or negative decimal value with any precision and scale. Allows for left-padded zeroes, commas as group separator, negative sign (-) or parenthesis to indicate negative number.
Matches
0.123 | (1234.123) | -01,200
Non-Matches
2.3.123 | 1,23.45
Author Rating: Not yet rated. Rich Franzmeier
Title Test Details Pattern Title
Expression
^[-+]?[0-9]\d{0,2}(\.\d{1,2})?%?$
Description
Required and regular expression validator. For supporting -999.99 to +999.99 . Positive and Negative integer/ decimal validations. Percentage sign is also supported. Will not allow empty strings. Can increase/decrease the range as you need.
Matches
12.3 | 123 | -123.45
Non-Matches
- | 10.1234 | -1234
Author Rating: Not yet rated. Error Reporter
Title Test Details Pattern Title
Expression
^-?[0-9]{0,2}(\.[0-9]{1,2})?$|^-?(100)(\.[0]{1,2})?$
Description
Matches a negative or positive percentage between 0 and 100 (inclusive). Accepts up to 2 decimal places.
Matches
12.34 | 100.00 | -2.1
Non-Matches
101.1 | 10.123 | 100.10
Author Rating: Not yet rated. Andrei Bozantan
Title Test Details Pattern Title
Expression
^([1-9]{0,1})([0-9]{1})(\.[0-9])?$
Description
Matches numbers 0 through 99.9 Allows only one preceding zero and does not require the decimal point
Matches
1 | 1.1 | 0.1
Non-Matches
01 | 01.1 | 0.10
Author Rating: The rating for this expression. Tim Macrina
Title Test Details Pattern Title
Expression
^[0-9]*(\.)?[0-9]+$
Description
it will check for the +ve decimal numbers
Matches
1 | 123 | 132.132
Non-Matches
1.2.2 | -123
Author Rating: Not yet rated. himraj love
Title Test Details Pattern Title
Expression
(^[+]?\d*\.?\d*[1-9]+\d*$)|(^[+]?[1-9]+\d*\.\d*$)
Description
Accepts only positive decimal values. Zero and negative numbers are non-matching.Allows zeros after last non-zero numeric value after decimal place for significant digits
Matches
01.23 | 0.15 | 0.1568
Non-Matches
0 | -0.18 | .0
Author Rating: Not yet rated. Miguel Gutierrez
Title Test Details Pattern Title
Expression
(^\d*\.?\d*[0-9]+\d*$)|(^[0-9]+\d*\.\d*$)
Description
This matches all positive decimal values. There was one here already which claimed to but would fail on value 0.00 which is positive AFAIK...
Matches
0.00 | 1.23 | 4.56
Non-Matches
-1.03 | -0.01 | -0.00
Author Rating: The rating for this expression. Derek Noonan
Title Test Details Pattern Title
Expression
^\-?[0-9]{1,3}(\,[0-9]{3})*(\.[0-9]+)?$|^[0-9]+(\.[0-9]+)?$
Description
Formatted Number with "," as thousand separator and "." as decimal separator. now accept numbers without separators of thousands.
Matches
10,000,000.123 | 3.14159265
Non-Matches
2.7,1828183
Author Rating: Not yet rated. German Gonzalez
Title Test Details Pattern Title
Expression
^(?=.*[1-9].*$)\d{0,7}(?:\.\d{0,9})?$
Description
Allows up to seven digits to the left and up to nine digits to the right of an optional decimal place. Leading zeros on the left of the decimal are accepted. Only positive values are accepted.
Matches
1 | 0123456.123456789 | .123456789
Non-Matches
.0123456789 | 0.0 | -1
Author Rating: Not yet rated. Bri Gipson
Title Test Details Currency
Expression
^\$( )*\d*(.\d{1,2})?$
Description
Validates US currency but allows for spaces between the dollar sign and dollar amount. If there is cents the period validates to two decimal places
Matches
$100.00 | $100 | $10.25
Non-Matches
100. | $10.233 | $10.
Author Rating: Not yet rated. Vincent Faller
Title Test Details Pattern Title
Expression
^(\$\ |\$)?((0|00|[1-9]\d*|([1-9]\d{0,2}(\,\d{3})*))(\.\d{1,4})?|(\.\d{1,4}))$
Description
Allows for a dollar sign with no space after, a dollar sign with a space after, and no dollar sign. Also makes sure theres no more than 4 decimal places. Takes out leading zeros if the number isn't 0, and protects against blank entries.
Matches
$ 123.4 | $00.5 | 200,000
Non-Matches
$012,234.44 | -39.05 | $45,23,330.00
Author Rating: Not yet rated. Corey Charlton
   Displaying page 1 of 1 pages; Items 1 to 42

Copyright © 2001-2014, RegexAdvice.com | ASP.NET Tutorials