Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2023-12-01 08:56
Flavor·PCRE2 (PHP)

/
^(1[0-2]|0?[1-9]):[0-5][0-9] (AM|PM)$
/
gm
Open regex in editor

Description

Use this expression to validate a 12 hour time input

Submitted by Amit Sharma