DateTime > Duration (ISO 8601) - Find Favorite

Finds an ISO 8601 formatted duration in a larger string.

P1Y2DT3M means 1 year (1Y), 2 days (2D), and 3 minutes (3M).

Sample Matches
Text Result
Duration: P1Y2D
Group #0
P1Y2D
Group #1
Group #2
1
Group #4
2
Group #5
D
match
<Duration>-P1Y2DT0H3M</Duration>
Group #0
-P1Y2DT0H3M
Group #1
-
Group #2
1
Group #4
2
Group #5
D
Group #6
0
Group #7
3
match
PT3M0no match
DP1Dno match
Match Groups
1
negative ('-' == negative, empty == positive)
2
years
3
months
4
days/weeks
5
W or D (W == weeks, D == days)
6
hours
7
minutes
8
seconds