Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^((([1-9]|1[0-2])(| )[apAP][mM])((| )-(| )| to )(([1-9]|1[0-2])(| )[apAP][mM])|TBD|tbd)\s*$
/

Description

following input formats work--

10am to 3pm 1am - 2pm 12pm-3pm

Submitted by anonymous - 9 years ago