107 regular expressions found in this category!
Displaying page
of
pages;
Items to
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 >=100,00 <=99999,99
100,00=100
5000,00 = 5000 |
Matches |
100,00 | 100 | 99999,99 |
Non-Matches |
99,99 | 999999 | 1,00 |
Author |
Rating:
Felipe Albacete
|
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:
brent stineman
|
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:
Paul Ashton
|
Title |
Test
Details
Currency
|
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 the is a comma it must be followed by 3 digits
|(\d+)) # more than 3 digit with no comma separator
(\.\d{2})?$ # option cents |
Description |
This regex validates Currency. The base monetary unit (ex. US dollar) followed by option two digit cent denomination. Base unit can't have leading zero. Comma's are optional on base units. Note: Your regex engine must support the \p character class to use this. For example this will work in .net but not javascript which doesn't support \p Also the ¢ is removed from the match by force. Any other cent symbol would need to be added to the exclude to not match. |
Matches |
$1,501.13 | £215 | €4.93 |
Non-Matches |
01.00 | $.00 | ¢50 |
Author |
Rating:
Michael Ash
|
Title |
Test
Details
Pattern Title
|
Expression |
(?'DateLiteral' (?# Per the VB Spec : DateLiteral ::= '#' [ Whitespace+ ] DateOrTime [ Whitespace+ ] '#' )
\#\s*
(?'DateOrTime' (?# DateOrTime ::= DateValue Whitespace+ TimeValue | DateValue | TimeValue )
(?'DateValue'
(?# DateValue ::= Whitespace+ TimeValue | DateValue | TimeValue )
(
(?# DateValue ::= MonthValue / DayValue / YearValue | MonthValue - DayValue - YearValue )
(?'Month'(0?[1-9])|1[0-2]) (?# Month 01 - 12 )
(?'Sep'[-/]) (?# Date separator '-' or '/' )
(?'Day'0?[1-9]|[12]\d|3[01]) (?# Day 01 - 31 )
\k'Sep' (?# whatever date separator was previously matched )
(?'Year'\d{1,4})
\s+
(?# TimeValue ::= HourValue : MinuteValue [ : SecondValue ] [ WhiteSpace+ ] [ AMPM ] )
(?'HourValue'(0?[1-9])|1[0-9]|2[0-4]) (?# Hour 01 - 24 )
[:]
(?'MinuteValue'0?[1-9]|[1-5]\d|60) (?# Minute 01 - 60 )
[:]
(?'SecondValue':0?[1-9]|[1-5]\d|60)? (?# Optional Minute :01 - :60 )
\s*
(?'AMPM'[AP]M)?
)
|
(
(?# DateValue ::= MonthValue / DayValue / YearValue | MonthValue - DayValue - YearValue )
(?'Month'(0?[1-9])|1[0-2]) (?# Month 01 - 12 )
(?'Sep'[-/]) (?# Date separator '-' or '/' )
(?'Day'0?[1-9]|[12]\d|3[01]) (?# Month 01 - 31 )
\k'Sep' (?# whatever date separator was previously matched )
(?'Year'\d{4})
)
|
(
(?# TimeValue ::= HourValue : MinuteValue [ : SecondValue ] [ WhiteSpace+ ] [ AMPM ] )
(?'HourValue'(0?[1-9])|1[0-9]|2[0-4]) (?# Hour 01 - 24 )
[:]
(?'MinuteValue'0?[1-9]|[1-5]\d|60) (?# Minute 01 - 60 )
[:]
(?'SecondValue':0?[1-9]|[1-5]\d|60)? (?# Optional Minute :01 - :60 )
\s*
(?'AMPM'[AP]M)?
)
)
)
\s*\#
) |
Description |
Match the VB Language specification BNF for DateTime literal. http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfvbspec2_4_6.asp?frame=true
DateLiteral ::= # [ Whitespace+ ] DateOrTime [ Whitespace+ ] #
DateOrTime ::=
DateValue Whitespace+ TimeValue |
DateValue |
TimeValue
DateValue ::=
MonthValue / DayValue / YearValue |
MonthValue – DayValue - YearValue
TimeValue ::=
HourValue : MinuteValue [ : SecondValue ] [ WhiteSpace+ ] [ AMPM ]
MonthValue ::= IntLiteral
DayValue ::= IntLiteral
YearValue ::= IntLiteral
HourValue ::= IntLiteral
MinuteValue ::= IntLiteral
SecondValue ::= IntLiteral
AMPM ::= AM | PM
|
Matches |
# 8/23/1970 3:45:39AM # | # 8/23/1970 # |
Non-Matches |
## | # 23/8/1970 # |
Author |
Rating:
Darren Neimke
|
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:
c raz
|
Title |
Test
Details
Pattern Title
|
Expression |
^[1-5]$ |
Description |
This matches a single numeric digit between 1 and 5, and is the same as saying ^[12345]$. |
Matches |
1 | 3 | 4 |
Non-Matches |
6 | 23 | a |
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 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 |
(^\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:
Derek Noonan
|
Title |
Test
Details
Pattern Title
|
Expression |
(^[0-9]*[1-9]+[0-9]*\.[0-9]*$)|(^[0-9]*\.[0-9]*[1-9]+[0-9]*$)|(^[0-9]*[1-9]+[0-9]*$) |
Description |
Positive real number greater than zero. |
Matches |
0.01 | 010001.011010 | .234 |
Non-Matches |
0.00 OR . | 010001.011010E | 1.234.5 |
Author |
Rating:
will gunby
|
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 |
([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)|([0-9]+) |
Description |
This is just a very simple matcher for real numbers. |
Matches |
123.456 | .123 | 123 |
Non-Matches |
. | apple | pear |
Author |
Rating:
Paul DeMarco
|
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:
Tim Macrina
|
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*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 |
(^(\+?\-? *[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 |
^[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 |
^(\-)?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]+$ |
Description |
it will check for the +ve decimal numbers |
Matches |
1 | 123 | 132.132 |
Non-Matches |
1.2.2 | -123 |
Author |
Rating:
himraj love
|
Displaying page
of
pages;
Items to