Regular Expressions 101

Community Patterns

Day/Hour/Minute/Second Time Detection Python

0

Regular Expression
Python

r"
^((\d+)d)?((\d+)h)?((\d+)(?:min|m))?((\d+)s)?$
"
gm

Description

Detects a number of days, hours, minutes, and/or seconds for a Python regex to handle.

Submitted by anonymous - 3 years ago