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

Please support RegExLib Sponsors

Sponsors

Browse Expressions by Category

107 regular expressions found in this category!

Expressions in category: Numbers

Change page:   |    Displaying page 6 of 6 pages; Items 101 to 107
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{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
^[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: Not yet rated. William Powell
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|,)*\.?\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
^\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{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
Change page:   |    Displaying page 6 of 6 pages; Items 101 to 107

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