Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?:(?<days>\d+)d)?(?:(?<minutes>\d+)m)?(?:(?<seconds>\d+)s)
/
gm
Input 1
1
New
987d6m5s 6m5s 5s
Substitution
Days: $1; Minutes: $2; Seconds: $3
987d6m5s 6m5s 5s