Regular Expressions 101

Community Patterns

Community Library Entry

3

Regular Expression
ECMAScript (JavaScript)

/
(0?[0-9]|1[0-9]|2[0-3]):[0-9]+:(0?[0-9]|[1-5][0-9])
/

Description

validates strings in time format HH:mm with hour in 24h format. only accepts up to 23:59

Submitted by Kelps Leite de Sousa - 9 years ago (Last modified a year ago)