XML Schema (XSD) 1.0 xs:pattern regex to match 4 digits as a string?

天涯浪子 提交于 2019-12-04 21:15:12

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

<xs:assert test="not(contains($value, '1234') or contains($value, '9999'))"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!