With lookaround, this regular expression will reject P
and PT
as invalid duration strings. If your library does not support lookaround, I recommend that you use Full ISO 8601 Duration without lookaround (also in the library) instead, with the caveat that you will need to verify the string is not P
or PT
, which will be incorrectly accepted.