Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^-?(((([0][0-9])|([1][0-3])):(([03][0])|([14][5])))|14:00)
/
gm

Description

TimeZone Offset parsing regular expression with below rules: Starts with optional - sign Range is between -14:00 to 14:00 including both the values Hours can have any value in range 00 to 14 and should have double digits Minutes can have discrete values of 00, 15, 30, 45

Submitted by anonymous - 5 years ago