Regular Expressions 101

Library entries

US datetime

Vote

2

Regular Expression
javascript

/
^([1-9]|(?=0)0[1-9]|(?=1)1[0-2])[-/.]([1-9]|(?=[0-2])[0-2][0-9]|(?=3)3[0-1])[-/.](\d{4}|\d{2})( ([1-9]|(?=[0-1])[0-1][0-9]|(?=2)2[0-4]):(?=[0-5])[0-5][0-9](:(?=[0-5])[0-5][0-9])?(a|p|A|P|am|pm|AM|PM)?)?$
/
gm

Description

Loading markdown...
Submitted by anonymous - 6 years ago