Skip to content

xsd:duration regex is not correct #516

@a-kleinf

Description

@a-kleinf

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)$

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions