← GalleryDatetime any format✨ Emoji Combos/^(?#day)(?>(?<day>[0-9]+)(?:(d$)|(d(?=[0-9]))|(:(?=[0-9]+(:|h)[0-9]+(:|m)[0-9]+))))?(?#dayEnd )(?#hour)(?>(?<hour>[0-9]+)(?:(h$)|(h(?=[0-9]))|(:(?=[0-9]+(:|m)[0-9]+))))?(?#hourEnd )(?#min)(?>(?<min>[0-9]+)(?:(m$)|(m(?=[0-9]))|(:(?=[0-9]))))?(?#minEnd )(?#sec)(?>(?<sec>[0-9]+((\.|\,)[0-9]*)?)(?:s|$))?(?#secEnd )(?#msec)(?>(?<msec>[0-9]+)(?:(ms$|$)))?(?#msec)$/mgPCRE2+12 years ago✓ Pre-loaded
About this regex
Matches a flexible duration/datetime string that can include day, hour, minute, second, and millisecond components. Values may be separated by suffixes (d, h, m, s, ms) or colons, and seconds can include decimal fractions. Named capture groups (day, hour, min, sec, msec) extract each time component for further processing.