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: 210 regular expressions found.

Change page:   |    Displaying page 1 of 11 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
^#?([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?$
Description
Tests for valid HTML hexadecimal color codes. The # symbol is optional. And it will except either the 3 digit form for the 216 Web safe colors, or the full 6 digit form. I am use it on my site to allow users to customize the site's colors.
Matches
#00ccff | #039 | ffffcc
Non-Matches
blue | 0x000000 | #ff000
Author Rating: The rating for this expression. Chris Craft
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
\b(([01]?\d?\d|2[0-4]\d|25[0-5])\.){3}([01]?\d?\d|2[0-4]\d|25[0-5])\b
Description
Most Concise RegExp for matching Decimal IPs. If nothing else, it'll make your code easier to read. (And I know that \d?\d is \d{1,2} but that's 2 extra characters.) --Update: darkone noticed 8 characters could be shaved down. I've edited it to reflect this. Thanks, darkone!
Matches
217.6.9.89 | 0.0.0.0 | 255.255.255.255
Non-Matches
256.0.0.0 | 0978.3.3.3 | 65.4t.54.3
Author Rating: The rating for this expression. Sean Schricker
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: The rating for this expression. 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: The rating for this expression. Jaime Borges
Title Test Details Pattern Title
Expression
^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$
Description
This will grep for a valid MAC address , with colons seperating octets. It will ignore strings too short or long, or with invalid characters. It will accept mixed case hexadecimal. Use extended grep.
Matches
01:23:45:67:89:ab | 01:23:45:67:89:AB | fE:dC:bA:98:76:54
Non-Matches
01:23:45:67:89:ab:cd | 01:23:45:67:89:Az | 01:23:45:56:
Author Rating: Not yet rated. Ted Rudyk
Title Test Details Pattern Title
Expression
^[0-9](\.[0-9]+)?$
Description
matches non-negative decimal floating points numbers less than 10
Matches
1.2345 | 0.00001 | 7
Non-Matches
12.2 | 1.10.1 | 15.98
Author Rating: The rating for this expression. Snikwad Kcirtap
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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. Kevin Read
Title Test Details Pattern Title
Expression
^\s*(?'num'\d+(\.\d+)?)\s*(?'unit'((w(eek)?)|(wk)|(d(ay)?)|(h(our)?)|(hr))s?)(\s*$)
Description
Validates Microsoft Project-type duration entries. Accepts a number and a unit. The number part can be integer or decimal. The unit can be several variations of weeks, days, and hours: e.g., w, wk, week, ws, wks, weeks are all valid. Whitespace between the number and the unit is optional: e.g., 1d, 2 days, 3.5w are all valid. Captures the number value in a group named num and the unit string in a group named 'unit'.
Matches
1 day | 3.5 w | 6hrs
Non-Matches
1 | 6. days | 1 week 2 d
Author Rating: Not yet rated. Steve Fisher
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
Change page:   |    Displaying page 1 of 11 pages; Items 1 to 20

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