我使用正则表达式是yes no type。但编译器抛出这样的异常。
<xsd:simpleType name="YesNoType">
<xsd:annotation>
<xsd:documentation>
Type for yes and no inputs.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:pattern value="(?:Y|N)"/>
</xsd:restriction>
</xsd:simpleType>
InvalidRegex:模式值'(?:Y | N)'不是有效的正则表达式。报告的错误是:'当前选项设置不支持此表达式。'。
请帮我解决这个问题。
答案 0 :(得分:3)
只需用类似
之类的东西替换它Y|N
或者
[YN]
之类的。
在所有版本的正则表达式中都没有实现非捕获parens。