How can I match a specific sequence of digits as if it were a string in an XML Schema xs:pattern
?
Say I have some tags containing arbitrary 10-character strings like
<string>12345678990</string>
And I want to rule out all tags with a specific blacklist of arbitrary sequences like 1234
, 2435
, ``9587`, or some such.
How do I address the specific 4-digit sub-string in order to negate it and add it to a list of xs:pattern
restrictions for <string>
's content model?
I don't think there is any practical XSD-compliant regular expression that will match all strings except those containing "1234" as a substring. (And therefore your more challenging requirement of banning several substrings also cannot be met).
This is one for XSD 1.1 assertions, for example