Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^([0-1][0-9]|[2][0-3]):([0-5][0-9])$ |
Description |
Matches a string if it is a valid time in the format of HH:MM |
Matches |
02:04 | 16:56 | 23:59 |
Non-Matches |
02:00 PM | PM2:00 | 24:00 |
Author |
Rating:
Not yet rated.
Koen Hoorelbeke
|
Title |
Test
Details
Pattern Title
|
Expression |
^(\(?\+?[0-9]*\)?)?[0-9_\- \(\)]*$ |
Description |
A regular expression to match phone numbers, allowing for an international dialing code at the start and hyphenation and spaces that are sometimes entered. |
Matches |
(+44)(0)20-12341234 | 02012341234 | +44 (0) 1234-1234 |
Non-Matches |
(44+)020-12341234 | 12341234(+020) |
Author |
Rating:
James Burton
|
Title |
Test
Details
Pattern Title
|
Expression |
^(20|21|22|23|[0-1]\d)[0-5]\d$ |
Description |
This regular expression will match a 24 hour time with no separators. |
Matches |
1200 | 1645 | 2359 |
Non-Matches |
2400 | asbc | 12:45 |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^( [1-9]|[1-9]|0[1-9]|10|11|12)[0-5]\d$ |
Description |
Matches a 12-hour time value expressed as either 4 numeric digits, 3 numeric digits, or a space and 3 numeric digits. 3 digit times (930) can be expressed with leading 0's (0930) or not. AM/PM designation is not included in this expression. |
Matches |
1145 | 933 | 801 |
Non-Matches |
0000 | 1330 | 8:30 |
Author |
Rating:
Not yet rated.
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^((((([13578])|(1[0-2]))[\-\/\s]?(([1-9])|([1-2][0-9])|(3[01])))|((([469])|(11))[\-\/\s]?(([1-9])|([1-2][0-9])|(30)))|(2[\-\/\s]?(([1-9])|([1-2][0-9]))))[\-\/\s]?\d{4})(\s((([1-9])|(1[02]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$ |
Description |
This expression can be used validate a datetime column from SQL Server. Big parts of it where taken from other samples on RegexLib. Please feel free to take it apart and improve it. |
Matches |
3/3/2003 | 3/3/2002 3:33 pm | 3/3/2003 3:33:33 am |
Non-Matches |
13/1/2002 | 3/3/2002 3:33 | 31/3/2002 |
Author |
Rating:
Not yet rated.
Scott Watermasysk Watermasysk
|
Title |
Test
Details
Pattern Title
|
Expression |
(^([0-9]|[0-1][0-9]|[2][0-3]):([0-5][0-9])$)|(^([0-9]|[1][0-9]|[2][0-3])$) |
Description |
Matches a string if it is a valid time in the format of HH:MM / H:MM / HH / H |
Matches |
10:35 | 9:20 | 23 |
Non-Matches |
24:00 | 20 PM | 20:15 PM |
Author |
Rating:
Nacho Varas
|
Title |
Test
Details
Pattern Title
|
Expression |
^((([0]?[1-9]|1[0-2])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?( )?(AM|am|aM|Am|PM|pm|pM|Pm))|(([0]?[0-9]|1[0-9]|2[0-3])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?))$ |
Description |
Matches times seperated by either : or . will match a 24 hour time, or a 12 hour time with AM or PM specified. Allows 0-59 minutes, and 0-59 seconds. Seconds are not required. |
Matches |
1:01 AM | 23:52:01 | 03.24.36 AM |
Non-Matches |
19:31 AM | 9:9 PM | 25:60:61 |
Author |
Rating:
Not yet rated.
Steve Valaitis
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/[2][0]\d{2})$|^(([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/[2][0]\d{2}\s([0-1]\d|[2][0-3])\:[0-5]\d\:[0-5]\d)$ |
Description |
Correct French DateTime(DD/MM/YYYY OR DD/MM/YYYY HH:MM:SS) |
Matches |
12/01/2002 | 12/01/2002 12:32:10 |
Non-Matches |
32/12/2002 | 12/13/2001 | 12/02/06 |
Author |
Rating:
Samir AZZA
|
Title |
Test
Details
Pattern Title
|
Expression |
^((((31\/(0?[13578]|1[02]))|((29|30)\/(0?[1,3-9]|1[0-2])))\/(1[6-9]|[2-9]\d)?\d{2})|(29\/0?2\/(((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])\/((0?[1-9])|(1[0-2]))\/((1[6-9]|[2-9]\d)?\d{2})) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$ |
Description |
this expression validates a date-time field in European d/m/y h:m:s format. It is a european variation of Michael Ash's date-validation expression in this library.
The days are validated for the given month and year. Leap years are validated for all 4 digits years from 1600-9999, and all 2 digits years except 00 |
Matches |
29/02/2004 20:15:27 | 29/2/04 8:9:5 | 31/3/2004 9:20:17 |
Non-Matches |
29/02/2003 20:15:15 | 2/29/04 20:15:15 | 31/3/4 9:20:17 |
Author |
Rating:
Not yet rated.
martin devos
|
Title |
Test
Details
Pattern Title
|
Expression |
(^([0-9]|[0-1][0-9]|[2][0-3]):([0-5][0-9])(\s{0,1})(AM|PM|am|pm|aM|Am|pM|Pm{2,2})$)|(^([0-9]|[1][0-9]|[2][0-3])(\s{0,1})(AM|PM|am|pm|aM|Am|pM|Pm{2,2})$) |
Description |
Validate “Time” Data to Work with SQL Server
This is a fix (I hope) for a problem with the original expression. It originally allowed any combination of am or pm. For example: ma, aa, mm, mp, etc. |
Matches |
8am | 8 am | 8:00 am |
Non-Matches |
8a | 8 a | 8:00 a |
Author |
Rating:
Not yet rated.
Greg Burns
|
Title |
Test
Details
Pattern Title
|
Expression |
^.+@[^\.].*\.[a-z]{2,}$ |
Description |
Most email validation regexps are outdated and ignore the fact that domain names can contain any foreign character these days, as well as the fact that anything before @ is acceptable. The only roman alphabet restriction is in the TLD, which for a long time has been more than 2 or 3 chars (.museum, .aero, .info). The only dot restriction is that . cannot be placed directly after @.
This pattern captures any valid, reallife email adress. |
Matches |
|
Non-Matches |
|
Author |
Rating:
Thor Larholm
|
Title |
Test
Details
Pattern Title
|
Expression |
^([0]\d|[1][0-2])\/([0-2]\d|[3][0-1])\/([2][01]|[1][6-9])\d{2}(\s([0-1]\d|[2][0-3])(\:[0-5]\d){1,2})?$ |
Description |
This is a regular expression to validate a date string in "MM/DD/YYYY" format, a date time string in "MM/DD/YYYY HH:MM" or a date time string in "MM/DD/YYYY HH:MM:SS" format.
It can validate date from 1600 to 2199.
|
Matches |
12/30/2002 | 01/12/1998 13:30 | 01/28/2002 22:35:00 |
Non-Matches |
13/30/2002 | 01/12/1998 24:30 | 01/28/2002 22:35:64 |
Author |
Rating:
Spring Zhang
|
Title |
Test
Details
Pattern Title
|
Expression |
^([0]\d|[1][0-2])\/([0-2]\d|[3][0-1])\/([2][01]|[1][6-9])\d{2}(\s([0]\d|[1][0-2])(\:[0-5]\d){1,2})*\s*([aApP][mM]{0,2})?$ |
Description |
This is a combination of a few regular expressions found on this site. It allows for a flexible date and time combination, but requires a 12-hour clock (am/pm). Many versions of the am/pm are supported. |
Matches |
12/31/2002 | 12/31/2002 08:00 | 12/31/2002 08:00 AM |
Non-Matches |
12/31/02 | 12/31/2002 14:00 |
Author |
Rating:
Not yet rated.
Bill LaPrade
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([0]?[1-9]|1[0-2])(:)([0-5][0-9]))$ |
Description |
This time validation expression accepts an hour between 1 and 9 (with optional leading zero) and minutes between 01 and 59. This is primarily for use with an AM/PM drop down list or radio button. |
Matches |
09:00 | 9:00 | 11:35 |
Non-Matches |
13:00 | 9.00 | 6:60 |
Author |
Rating:
Not yet rated.
Ken Madden
|
Title |
Test
Details
Pattern Title
|
Expression |
^ *(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M) *$ |
Description |
validate 12-hour time with am/pm after it, with optional spaces before or after, and optionally between time and am/pm. |
Matches |
12:00am | 1:00 PM | 12:59 pm |
Non-Matches |
0:00 | 0:01 am | 13:00 pm |
Author |
Rating:
Not yet rated.
Jim Tebbel
|
Title |
Test
Details
Pattern Title
|
Expression |
(([0-1][0-9])|([2][0-3])):([0-5][0-9]):([0-5][0-9]) |
Description |
Validates time in MySQL time format. 24 hour time colon seperated hours:minutes:seconds |
Matches |
09:30:00 | 17:45:20 | 23:59:59 |
Non-Matches |
24:00:00 |
Author |
Rating:
Patrick O'Hara
|
Title |
Test
Details
Pattern Title
|
Expression |
^((([0]?[1-9]|1[0-2])(:|\.)(00|15|30|45)?( )?(AM|am|aM|Am|PM|pm|pM|Pm))|(([0]?[0-9]|1[0-9]|2[0-3])(:|\.)(00|15|30|45)?))$ |
Description |
This expression will allow a time value with 15 minute increments. It will not accept seconds. You can use either US time or Military time format. |
Matches |
1:00 PM | 6:45 am | 17:30 |
Non-Matches |
4:32 am | 5:30:00 am | 17:01 |
Author |
Rating:
Not yet rated.
Rick Yokum
|
Title |
Test
Details
Pattern Title
|
Expression |
^([0-1]?[0-9]|[2][0-3]):([0-5][0-9])$ |
Description |
Accepts data of time in format h:mm and hh:mm
^([0-1]?[0-9]|[2][0-3]):([0-5][0-9])$
in php [0-23]:[0-59]{2} (posix) |
Matches |
0:00 | 23:00 | 00:59 |
Non-Matches |
0:0 | 24:00 | 00:60 |
Author |
Rating:
Morten Henriksen
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([0]?[0-5][0-9]|[0-9]):([0-5][0-9]))$ |
Description |
This regex is to validate the time of a ~60 minute CD where the most time on the CD is 59:59 (minutes:seconds). It is derived from Ken Madden's time regex for a project for Erik Porter (Windows/Web guru). Written by Jason Gaylord. |
Matches |
30:05 | 5:05 | 02:59 |
Non-Matches |
25:7 | 5m:16 | 60:60 |
Author |
Rating:
Not yet rated.
Jason N. Gaylord
|
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
|
Displaying page
of
pages;
Items to