I tried with the following regular expression but it is not working as expected.
/^([01]?[0-9]|2[0-3]):[0-5][0-9]{2}(AM|PM)/
I tried with the following regular expression but it is not working as expected.
/^([01]?[0-9]|2[0-3]):[0-5][0-9]{2}(AM|PM)/
You are missing space before AM|PM and there is unnecessary {2}
The following changes works for me:
^([01]?[0-9]|2[0-3]):[0-5][0-9] (AM|PM)
On the string
09:15 AM