Test, validate and match regular expressions
Matches PHP DateInterval (ISO 8601 style) duration strings containing a single unit: 'P' followed by a number from 1-99 (no leading zeros) and a unit designator of weeks (W), days (D), months (M), or hours (H), e.g. P5D, P12W, P3M. Alternatively matches the time form 'PT' followed by 1-99 hours, e.g. PT2H or PT45H. Useful for validating simple duration inputs in forms, API parameters, or configuration values where only one interval component is permitted.