AG
Regex
AGREGEX
About
Cheat Sheet
Pattern Library
Guides
Contact
한국어
English
日本語
中文
Español
Português
Français
Deutsch
Русский
العربية
Bahasa Indonesia
← Pattern Library
PATTERN
24-Hour Time
Regex Pattern
Date · Time
/
\b([01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?\b
/g
Copy
/\b([01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?\b/g
Date · Time
Flags:
g
Description
Matches 24-hour times from 00:00 to 23:59, with seconds (:SS) being optional. Each of the hours, minutes, and seconds is limited to its valid range. Useful for parsing log timestamps or schedules.
Example Matches
09:30
23:59:59
00:00
Test String
Meeting 09:30, deadline 23:59:59, invalid 24:61
Open this pattern in the tester
Other Patterns
ISO Date (YYYY-MM-DD)
← Pattern Library