【发布时间】:2013-01-29 22:23:41
【问题描述】:
我正在尝试使用正则表达式和 xsd:pattern 进行限制,以仅允许在 ASCII 值的特定范围内最多包含 10 个字符的字符。具体从 ASCII 值 33 到 126。
截至目前,我正在尝试修改以下 sn-p。
<xsd:simpleType name="Name">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[(\p{L}|\d)._-]{0,9}"/>
</xsd:restriction>
</xsd:simpleType>
我拥有的另一个选项是在正则表达式中列出从 33 到 126 的单个 ASCII 字符。截至目前,我拒绝走这条路。
【问题讨论】: