Build, test, and debug regular expressions
This regex validates and parses ISO 8601 duration strings. It matches durations like 'P1Y2M3DT4H5M6S' (1 year, 2 months, 3 days, 4 hours, 5 minutes, 6 seconds). The pattern requires a leading 'P', allows optional date components (Y, M, D), and optional time components (H, M, S) after a 'T' separator. All components use named capture groups for easy extraction in Go.