Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^(([1-9]|[0-2]\d|[3][0-1])\.([1-9]|[0]\d|[1][0-2])\.[2][0]\d{2})$|^(([1-9]|[0-2]\d|[3][0-1])\.([1-9]|[0]\d|[1][0-2])\.[2][0]\d{2}\s([1-9]|[0-1]\d|[2][0-3])\:[0-5]\d)$ |
Description |
Correct German DateTime. Does not check leap year rules!
Possible Formats of date part:
D.M.YYYY or D.MM.YYYY or DD.MM.YYYY or DD.M.YYYY
Possible formats of time part:
h:mm or hh:mm |
Matches |
20.10.2003 08:10 | 24.12.2003 | 1.1.2004 8:15 |
Non-Matches |
25.13.2004 | 20.10.2003 08:9 |
Author |
Rating:
Markus Unterauer
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([0-9])|([0-1][0-9])|([2][0-3])):(([0-9])|([0-5][0-9]))$ |
Description |
reg. expr. 4 checking 24 time |
Matches |
1:59 | 01:59 | 23:59 |
Non-Matches |
12:63 | 25:60 | 13.10 |
Author |
Rating:
Not yet rated.
Tomas Andrysek
|
Title |
Test
Details
Pattern Title
|
Expression |
(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3}) |
Description |
This is my all-time favourite e-mail validator. I've used it for years and it's never failed me :-) |
Matches |
|
Non-Matches |
|
Author |
Rating:
Darren Neimke
|
Title |
Test
Details
Pattern Title
|
Expression |
^[^#]([^ ]+ ){6}[^ ]+$ |
Description |
We've come across the situation where we had to extract the IIS-Log entries without the header information. The data is far more complex than the sample given.
Explanation:
^[^#] = lines not beginnin with #
([^ ]+ ){6} = 6 times no space until one space
[^ ]+ = no spaces allowed...
$ = ...until end of line
For further explanation don't hesitate to write E-Mail. |
Matches |
1111 2222 33 44444 55 6 7777 |
Non-Matches |
#IIS Logfile header |
Author |
Rating:
Not yet rated.
Volker Roth
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([0-9])|([0-1][0-9])|([2][0-3])):?([0-5][0-9])$ |
Description |
For testing 24H based time entry. Tests if there is a colon to separate the hours from the minutes |
Matches |
0959 | 959 | 9:59 |
Non-Matches |
90 | 960 | 24:00 |
Author |
Rating:
Not yet rated.
mana deys
|
Title |
Test
Details
Pattern Title
|
Expression |
^(((((0[13578])|([13578])|(1[02]))[\-\/\s]?((0[1-9])|([1-9])|([1-2][0-9])|(3[01])))|((([469])|(11))[\-\/\s]?((0[1-9])|([1-9])|([1-2][0-9])|(30)))|((02|2)[\-\/\s]?((0[1-9])|([1-9])|([1-2][0-9]))))[\-\/\s]?\d{4})(\s(((0[1-9])|([1-9])|(1[0-2]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$ |
Description |
Following expression can be used to validate a datetime column from SQL Server. This expression is an enhanced version of Scott Watermasysk's date/time submission. It now accepts leading zeros in months, days, and hours. In addition, this expression properly handles the 11th hour. Watermasysk's would take the 10th and 12th hour but not the 11th. This regex has been tweaked to do so. Does not handle the February 29th problem on non-leap years yet. Will learn a little more about RegEx and do so in later submission.
|
Matches |
11/30/2003 10:12:24 am | 2/29/2003 08:14:56 pm | 5/22/2003 |
Non-Matches |
11/31/2003 10:12:24 am | 2/30/2003 08:14:56 pm | 5/22/2003 14:15 |
Author |
Rating:
Not yet rated.
David Darling
|
Title |
Test
Details
DateTime M/d/y hh:mm:ss
|
Expression |
^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$ |
Description |
DateTime Validator. |
Matches |
12/25/2003 | 08:03:31 | 02/29/2004 12 AM |
Non-Matches |
02/29/2003 1:34 PM | 13:23 PM | 24:00:00 |
Author |
Rating:
Michael Ash
|
Title |
Test
Details
Time
|
Expression |
^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$|^([01]\d|2[0-3])(:[0-5]\d){0,2}$ |
Description |
This RE validates times patterns. |
Matches |
1 AM | 23:00:00 | 5:29:59 PM |
Non-Matches |
13 PM | 13:60:00 | 00:00:00 AM |
Author |
Rating:
Michael Ash
|
Title |
Test
Details
Pattern Title
|
Expression |
^((((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|([1-2][0-9]))))[\-\/\s]?\d{2}(([02468][048])|([13579][26])))|(((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))[\-\/\s]?\d{2}(([02468][1235679])|([13579][01345789]))))(\s(((0?[1-9])|(1[0-2]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$ |
Description |
This regex will match SQL Server datetime values, allowing date only, allowing zero padded digits in month, day and hour, and will match leap years from 1901 up until 2099. |
Matches |
2/29/2004 | 04/01/2003 10:01:23 am | 03-20-1999 |
Non-Matches |
2/29/2003 | 13/30/2001 10:05:00 pm | 12/32/2003 |
Author |
Rating:
Not yet rated.
Sung Lee
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([0]?[1-9]|1[0-2])/([0-2]?[0-9]|3[0-1])/[1-2]\d{3})? ?((([0-1]?\d)|(2[0-3])):[0-5]\d)?(:[0-5]\d)? ?(AM|am|PM|pm)?$ |
Description |
Matches variations on date/time/AM-PM. Must have 4 digit year, but everything else is open. Restrictions are: 4 digit year, months 1-12, hours 1-23, minutes and seconds 1-59, any case of AM and PM. If this don't woik, I wrote it, lemmy know. |
Matches |
12/30/2002 | 12/30/2002 9:35 pm | 12/30/2002 19:35:02 |
Non-Matches |
18/22/2003 | 8/12/99 | 8/22/2003 25:00 |
Author |
Rating:
Not yet rated.
Michael Gaertner
|
Title |
Test
Details
Pattern Title
|
Expression |
^\s*(((\d*\.?\d*[0-9]+\d*)|([0-9]+\d*\.\d*) )\s*[xX]\s*){2}((\d*\.?\d*[0-9]+\d*)|([0-9]+\d*\.\d*))\s*$ |
Description |
This validates Length times Width times Height measurements, which consists of 3 whole or decimal numbers separated by an x. |
Matches |
1.1 x 4.35 x 5.0 | 1 x 2 x 3 | 4.75 x 300.25 x 0 |
Non-Matches |
z.56 x 6 x 7 | 1 xx 2 x 3 | 1 by 2 by 3 |
Author |
Rating:
Not yet rated.
Rod Early
|
Title |
Test
Details
Pattern Title
|
Expression |
(.)\1{2,} |
Description |
matches any string with characters repeated more than twice, sometimes used as fake input |
Matches |
aaaeee | ???????? | gooogle |
Non-Matches |
google | booboo |
Author |
Rating:
Not yet rated.
Bernard Martin-Rabaud
|
Title |
Test
Details
Pattern Title
|
Expression |
(\w(\s)?)+ |
Description |
Used to verify that the string consists of only A-z, 0 - 9 and underscore. Several words allowed, only one space between them. No spaces up front. Hey, I know it's easy, but it was not in the library! Plus, the test option here is not working well all the time. |
Matches |
Test | TesT | tesT9 _test9 |
Non-Matches |
\\\ |
Author |
Rating:
Not yet rated.
Alsu Fifty
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([8]))$|^((([0-7]))$|^((([0-7])).?((25)|(50)|(5)|(75)|(0)|(00))))$ |
Description |
Time off hours edit for quarter hour(s) less than eight. |
Matches |
0.25 | 7.75 | 8 |
Non-Matches |
8.25 | 7.15 | 0.15 |
Author |
Rating:
Not yet rated.
Bob Kranson
|
Title |
Test
Details
mm/dd/yyyy hh:MM:ss AM/PM DateTime
|
Expression |
(?n:^(?=\d)((?<month>(0?[13578])|1[02]|(0?[469]|11)(?!.31)|0?2(?(.29)(?=.29.((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00))|(?!.3[01])))(?<sep>[-./])(?<day>0?[1-9]|[12]\d|3[01])\k<sep>(?<year>(1[6-9]|[2-9]\d)\d{2})(?(?=\x20\d)\x20|$))?(?<time>((0?[1-9]|1[012])(:[0-5]\d){0,2}(?i:\x20[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$) |
Description |
New DateTime Regex. Rebuilt better than before, better, stronger, faster. |
Matches |
1/31/2002 10 AM | 2/29/2004 | 4:15:04 PM |
Non-Matches |
2/29/2003 | 12/32/2003 | 4:00 |
Author |
Rating:
Michael Ash
|
Title |
Test
Details
dd/mm/yyyy hh:MM:ss Datetime
|
Expression |
(?n:^(?=\d)((?<day>31(?!(.0?[2469]|11))|30(?!.0?2)|29(?(.0?2)(?=.{3,4}(1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00))|0?[1-9]|1\d|2[0-8])(?<sep>[/.-])(?<month>0?[1-9]|1[012])\2(?<year>(1[6-9]|[2-9]\d)\d{2})(?:(?=\x20\d)\x20|$))?(?<time>((0?[1-9]|1[012])(:[0-5]\d){0,2}(?i:\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$) |
Description |
DD/MM/YYYY format New DateTime Regex. Rebuilt better than before, better, stronger, faster. This regex will validate a date, time or a datetime. It will also capture the date fields and the time. Dates are in the DD/MM/YYYY format and validated for months, number of days in a month and leap years (29/2) Date field can be separated by matched periods(.), dashes(-) or forward slashes(/). Year range 1600-9999 Time is either 12 hour AM/PM format (HH:mm:ss AM), where minutes and seconds are optional. AM or PM required. or 24 hour military format (HH:mm:SS), from 00:00:00 to 23:59:59, where hours and minutes fields are required, including leading 0 for hours less than 10. Datetime is the above date and time formats separated by a space, with the date first (DD/MM/YYYY HH:mm:SS) !IMPORTANT NOTE: your regex engine must support lookaheads and named groups to use this expression |
Matches |
31/12/2003 | 29/2/2004 4:50 PM | 23:59:59 |
Non-Matches |
12/31/2003 | 29/2/2003 | 4:00 |
Author |
Rating:
Not yet rated.
Michael Ash
|
Title |
Test
Details
yyyy/mm/dd hhMMss Date
|
Expression |
^(?ni:(?=\d)((?'year'((1[6-9])|([2-9]\d))\d\d)(?'sep'[/.-])(?'month'0?[1-9]|1[012])\2(?'day'((?<!(\2((0?[2469])|11)\2))31)|(?<!\2(0?2)\2)(29|30)|((?<=((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00)\2\3\2)29)|((0?[1-9])|(1\d)|(2[0-8])))(?:(?=\x20\d)\x20|$))?((?<time>((0?[1-9]|1[012])(:[0-5]\d){0,2}(\x20[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2}))?)$ |
Description |
YYYY/MM/DD hh:mm:ss format DateTime Regex.
This regex will validate a date, time or a datetime.
It will also capture the date fields and the time.
Dates are in the YYYY/MM/DD format and validated for months, number of days in a month and leap years (29/2)
Date field can be separated by matched periods(.), dashes(-) or forward slashes(/)
Time is either 12 hour AM/PM format (hh:mm:ss AM), where minutes and seconds are optional.
AM or PM required. or 24 hour military format (hh:mm:ss), from 00:00:00 to 23:59:59,
where hours and minutes fields are required, including leading 0 for hours less than 10.
Please refer to http://blogs.regexadvice.com/mash/archive/2004/04/23/1021.aspx for additional info
Datetime is the above date and time formats separated by a space,
with the date first (YYYY/MM/DD hh:mm:ss)
!IMPORTANT NOTE: your regex engine must support lookbehinds and named groups to use this expression |
Matches |
12:30 PM | 2004-02-29 | 2004/3/31 02:31:35 AM |
Non-Matches |
2:00 | 2200.2.29 | 0000/00/00 00:00:00 AM |
Author |
Rating:
Michael Ash
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?=\d)(?:(?:31(?!.(?:0?[2469]|11))|(?:30|29)(?!.0?2)|29(?=.0?2.(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(?:\x20|$))|(?:2[0-8]|1\d|0?[1-9]))([-./])(?:1[012]|0?[1-9])\1(?:1[6-9]|[2-9]\d)?\d\d(?:(?=\x20\d)\x20|$))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\x20[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$ |
Description |
DateTime Validator. This RE validates both dates and/or times patterns. Days in Feb. are also validated for Leap years. Dates: in dd/mm/yyyy or d/m/yy format between 1/1/1600 - 31/12/9999. Leading zeroes are optional. Date separators can be either matching dashes(-), slashes(/) or periods(.) Times: in the hh:MM:ss AM/PM 12 hour format (12:00 AM - 11:59:59 PM) or hh:MM:ss military time format (00:00:00 - 23:59:59). The 12 hour time format: 1) may have a leading zero for the hour. 2) Minutes and seconds are optional for the 12 hour format 3) AM or PM is required and case sensitive. Military time 1) must have a leading zero for all hours less than 10. 2) Minutes are manditory. 3) seconds are optional. Datetimes: combination of the above formats. A date first then a time separated by a space. ex) dd/mm/yyyy hh:MM:ss This RE is an variation of one of my other Datetime (mm/dd/yyyy) validator already in this library http://www.regexlib.com/REDetails.aspx?regexp_id=369, so the same rules for leap year apply. All 4 digit year and all two digit years except 00, which might not be a leap year. |
Matches |
31/12/2003 11:59:59 PM | 29-2-2004 | 01:45:02 |
Non-Matches |
12/31/2003 | 29.02.2005 | 13:30 PM |
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
mm/dd/yyyy Julian and Gregrian Datetime
|
Expression |
(?#Calandar from January 1st 45 BC to December 31, 9999
in mm/dd/yyyy format)
(?!
(?:10(?<sep>[-./])(?:0?[5-9]|1[0-4])\k<sep>(?:1582))| #Missing days from 1582
(?:0?9(?<sep>[-./])(?:0?[3-9]|1[0-3])\k<sep>(?:1752)) #or Missing days from 1752
(?# both sets of missing days such not be in the same calendar
so remove one or the other)
)
(?n:^(?=\d) # the character at the beginning a the sring must be a digit
(
(?<month>
(0?[13578])|1[02]| #months with 31 days
(0?[469]|11)(?!.31)| # months with 30 days
0?2 # February
(?(.29) # if feb 29th check for valid leap year
(?=.29.
(?! #exclude these years from leap year pattern
000[04] #No year 0 and no leap year in year 4
|
(?:(?:1[^0-6]|[2468][^048]|[3579][^26])00)
(?# centurial years > 1500 not evenly divisible by 400
are not leap year)
)
(?:(?:(?:\d\d) # century
(?:[02468][048]|[13579][26]) #leap years
(?!\x20BC))|(?:00(?:42|3[0369]|2[147]|1[258]|09)\x20BC))
)| # else if not Feb 29
(?!.3[01]) # and day not Feb 30 or 31
) #end Leap year check
) #end of month check
(?<sep>[-./]) # choose a date separator
(?<day>0?[1-9]|[12]\d|3[01]) #days between 1-31
(?# The maximum number of days allowed for a month has
already been checked for in the month check.
If you made it this far the number of day is
within the range for the given month)
\k<sep> # Match the same date separator choosen before.
(?!0000) # There is no year 0
(?<year>(?=(?:00(?:4[0-5]|[0-3]?\d)\x20BC)|(?:\d{4}(?:\z|(?:\x20\d))))\d{4}(?:\x20BC)? # a four digit year. Use leading zeros if needed
)
(?(?=\x20\d)\x20|$))? # if there is a space followed by a digit check for time
(?<time>
( # 12 hour format
(0?[1-9]|1[012]) # hours
(:[0-5]\d){0,2} # optional minutes and seconds
(?i:\x20[AP]M) # required AM or PM
)| # 24 hour format
(
[01]\d|2[0-3]) #hours
(:[0-5]\d){1,2}) #required minutes optional seconds
?$) |
Description |
Datetime for Julian and Gregorian Calenders
Matchs dates from 0001 A.D. to 9999 A.D.
Days and months are 1 or 2 digits
Years are 4 digit with leading zeros if required.
February is validate in all leap years
Leap year rules for Julian and Gregorian calendars (http://scienceworld.wolfram.com/astronomy/LeapYear.html)
Missing days for 1582 and 1752 are not matched. Though only one set should be applied to a calendar since they are caused by when the calendar was adopted
Missing days (http://scienceworld.wolfram.com/astronomy/GregorianCalendar.html)
Time can be either 12 or 24 hour format
12 hour format hh:MM:ss AM|PM
minutes and seconds are optional
24 hour format hh:mm:ss
seconds are optional, hours less than ten require leading zero
Datetome format is a date, a space then a time. |
Matches |
12/25/0004 | 12/31/0001 BC 2:15 AM | 2-29-2004 09:00 |
Non-Matches |
00/00/0000 | 2-29-2100 | 10/8/1582 |
Author |
Rating:
Not yet rated.
Michael Ash
|
Displaying page
of
pages;
Items to