Current definition of the REGEX for xsd:duration seems to be not correct (see: here)
current version: ^PT(\d+H)?(\d+M)?(\d+(.\d+)?S)?(?<!PT)$
matches wrong string: PT1g8S
In (.?\d+)?, the dot means “any single character”, not a literal decimal point.
The dot in the seconds fraction should be escaped resulting in:
^PT(\d+H)?(\d+M)?(\d+(\.\d+)?S)?(?<!PT)$
Current definition of the REGEX for xsd:duration seems to be not correct (see: here)
current version:
^PT(\d+H)?(\d+M)?(\d+(.\d+)?S)?(?<!PT)$matches wrong string:
PT1g8SIn
(.?\d+)?, the dot means “any single character”, not a literal decimal point.The dot in the seconds fraction should be escaped resulting in:
^PT(\d+H)?(\d+M)?(\d+(\.\d+)?S)?(?<!PT)$