Date-time Regular expressions __ regular expressions

Source: Internet
Author: User
Date-Time Regular Expressions

Regular expressions (? 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) | [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})? $)
The 31/12/2003 | 29/2/2004 4:50 PM | 23:59:59
does not match 12/31/2003 | 29/2/2003 | 4:00

Regular expressions ^(?:(? : 31 (\/|-|\.) (?: 0? [13578]|1[02]) \1| (?:(? : 29|30) (\/|-|\.) (?: 0? [1,3-9]|1[0-2]) \2)) (?:(? : 1[6-9]| [2-9]\d) \d{2}) $|^ (?: 29 (\/|-|\.) 0?2\3 (:(:(? : 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]) \4 (?:(? : 1[6-9]| [2-9]\d)? \d{2}) $
The 29/02/1972 | 5-9-98 | 10-11-2002
does not match 29/02/2003 | 12/13/2002 | 1-1-1500

Regular expressions ^(?:( ((uary)? | Ma (R (CH)? | Y) | June (y)? | Aug (UST)? | OCT (Ober)? | Dec (ember)?) \ 31) | ((uary)? | Ma (R (CH)? | Y) | APR (il)? | Ju ((ly?) | (NE?)) | Aug (UST)? | OCT (Ober)? | (sept| nov| DEC) (ember)? \ (0? [1-9]| ([12]\d) |30) | (Feb (ruary)? \ (0?[ 1-9]|1\d|2[0-8]| (29 (? =,\ (1[6-9]|[ 2-9]\d) (0[48]|[ 2468][048]| [13579] [26]) | ((16| [2468] [048]| [3579] [26]) 00))) \,\ (1[6-9]|[ 2-9]\d) \d{2})
The 1, 2003 | February 29, 2004 | November 02, 3202
does not match Feb 29, 2003 | APR 31, 1978 | 33,3333

Regular expressions ^ ([0-1]? [0-9]) | ([2][0-3]):( [0-5]? [0-9]) (:([0-5]? [0-9])? $
The 12:15 | 10:26:59 | 22:01:15
does not match 24:10:25 | 13:2:60

Regular expressions (? =\d) ^ (?:(?! (?: 10\d (?: 0?) [5-9]|1[0-4]) \d (?: 1582)) | (?: 0? 9\d (?: 0? [3-9]|1[0-3]) \d (?: 1752))) ((?: 0? [13578]|1[02]) | (?: 0? [469]|11] (?!) \/31) (?! -31) (?! \.31) | (?: 0? 2 (? =.? (?:(? : 29. (?!) 000[04]| (?:(? : 1[^0-6]| [2468] [^048]| [3579] [^26]) ) (:(:(?: \ d\d) (?: [02468][048]|[ 13579][26]) (?! \X20BC)) | (?: 0 0 (?: 42|3[0369]|2[147]|1[258]|09) \X20BC)) | (?: 0? 2 (? =. (?:(?: \ D\D) | (?: [01]\d) | (?: 2[0-8]))) ([-.\/]) (0?) [1-9]| [12]\d|3[01]) \2 (?! 0000) ((? = (?: 0 0 (?: 4[0-5]|[ 0-3]?\d) \X20BC | (?:\ D{4} (?! \X20BC)) \d{4} (?: \ X20BC)? (?:$| (? =\x20\d) \x20)? (?:(?: 0? [1-9]|1[012]) (?:: [0-5]\d) {0,2} (?: \ X20[AAPP][MM]) | (?: [01]\d|2[0-3]) (?:: [0-5]\d) {1,2})? $
The 11/24/0004 11:59 PM | 2.29.2008 | 02:50:10
does not match 12/33/1020 | 2/29/2005 | 13:00 AM

Regular expressions ^ ([0]? [1-9]| [1|2] [0-9]| [3] [0|1]) [./-] ([0]? [1-9]| [1] [0-2]) [./-] ([0-9]{4}| [0-9] {2}) $
The 10/03/1979 | 1-1-02 | 01.1.2003
does not match 10/03/197 | 09--02--2004 | 01 02 03

Regular expressions ^ (0? [13578]|10|12) (-|\/) (([1-9]) | ( 0[1-9]) | ([12]) ([0-9]?) | (3[01]) (-|\/) (() ([2-9]) (\d{1}) | (20) ([01]) (\d{1}) | ([8901]) (\d{1})) | (0?) [2469]|11) (-|\/) (([1-9]) | ( 0[1-9]) | ([12]) ([0-9]?) | (3[0]) (-|\/) (() ([2-9]) (\d{1}) | (20) ([01]) (\d{1}) | ([8901]) (\d{1})) $
The 1/2/03 | 02/30/1999 | 3/04/00
does not match 3/4/2020 | 3/4/1919 | 4/31/2000

Regular expressions ^ ([2-9]\d{3} (0[1-9]|1[012]) (0[1-9]|1\d|2[0-8]) | ( 0[13456789]|1[012]) (29|30) | (0[13578]|1[02]) 31) | (([2-9]\d) (0[48]|[ 2468][048]| [13579] [26]) | ([2468][048]| [3579] [26]) 00) 0229) $
The 20000101 | 20051231 | 20040229
does not match 19990101 | 20053112 | 20050229

Regular expressions ^ ([1-9]|1[0-2]|0[1-9]) {1} (: [0-5][0-9][aapp][mm]) {1}$
The 08:00am | 10:00am | 7:00pm
does not match 13:00pm | 12:65am

Regular expressions ^ ([1-9]) | (0[1-9]) | (1[0-2]) \/(([0-9]) | ([0-2][0-9]) | (3[0-1]) \/([0-9][0-9]) | ([1-2][0,9][0-9][0-9]) $
The 01/01/2001 | 1/1/1999 | 10/20/2080
does not match 13/01/2001 | 1/1/1800 | 10/32/2080

Regular expressions ^\d{1,2}\/\d{1,2}\/\d{4}$
The 4/1/2001 | 12/12/2001 | 55/5/3434
does not match 1/1/01 | 01 | 1-1-2001

Regular expressions (\d{2}|\d{4}) (?:\ -)? ([0]{1}\d{1}| [1] {1} [0-2] {1}) (?:\ -)? ([0-2]{1}\d{1}| [3] {1} [0-1] {1}) (?:\ s)? ([0-1]{1}\d{1}| [2] {1} [0-3] {1}) (?::)? ([0-5]{1}\d{1}) (?::)? ([0-5]{1}\d{1})
The 00-00-00 00:00:00 | 0000-00-00 00:00:00 | 09-05-22 08:16:00 |1970-00-00 00:00:00 | 20090522081600
does not match 2009-13:01 00:00:00 | 2009-12-32 00:00:00 | 2002-12-31 24:00:00 |2002-12-31 23:60:00 | 02-12-31 23:00:60

Regular expressions ^ (? =\d) (?:(?! (?: 1582 (?: \.| -|\/) 10 (?: \.| -|\/) (?: 0? [5-9]|1[0-4]) | (?: 1752 (?: \.| -|\/) 0?9 (?: \.| -|\/) (?: 0? [3-9]|1[0-3]))) (? = (?:(?! 000[04]| (?:(? : 1[^0-6]| [2468] [^048]| [3579] [^26]) ) (:(?: \ d\d) (?: [02468][048]|[ 13579][26]) \d0?2\d29) | (?:\ D{4}\d (?!) (?: 0? [2469]|11) \d31) (?! 0?2 (?: \.| -|\/) (?: 29|30)))) (\d{4}) ([-\/.]) (0?\d|1[012]) \2 ((?!) [012]?\d|3[01]) (?: $| (?) =\x20\d) \x20)? (?:(?: 0? [1-9]|1[012]) (?:: [0-5]\d) {0,2} (?: \ X20[AAPP][MM]) | (?: [01]\d|2[0-3]) (?:: [0-5]\d) {1,2})? $
The 0008-02-29 | 2:34:59 PM | 9999/12/31 11:59 PM
does not match 04/04/04 | 1:00 | 1999/1/32

Regular expressions ^ ([1-9]{1}) | ([0-1][0-9]) | ([1-2][0-3])

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.