Reputation: 599
I'm linting my first custom XML Schema and lxml gets caught on the expression representing a tuple such as "10.1,-900":
<xs:simpleType name="pair_dec">
<xs:restriction base="xs:string">
<xs:pattern value="-?\d+(?:.\d+),-?\d+(?:.\d+)"/>
</xs:restriction>
</xs:simpleType>
I've read that this is because there is no support for non-capturing groups. Is this right and is there a work around?
Upvotes: 0
Views: 503
Reputation: 626926
Mind that in XSD regex flavor:
\d
and all other shorthand character classes are Unicode aware, so it is safer to use [0-9]
instead of \d
Use
<xs:pattern value="-?[0-9]+(\.[0-9]+)?,-?[0-9]+(\.[0-9]+)?"/>
Upvotes: 1