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
/
^(?=\d)(?:\d+w\h*)?(?:\d+d\h*)?(?:\d+h\h*)?(?:\d+m)?$
/
gm
Input 1
1
1w 3d 5h 3m 32d 5h 3m 3pp 2h 35m 2d 5qq 3m 2d 35m 3h 1w
Extraction
1w 3d 5h 3m 32d 5h 3m 3pp 2h 35m 2d 5qq 3m 2d 35m 3h 1w