用 正则表达式 限定XML simpleType 定义

 <xsd:simpleType name="ResTrictions">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="s*0x[0-9,a-z,A-Z]{8}s*|s*"/>
    </xsd:restriction>
  </xsd:simpleType>
View Code

匹配各种空值或者4个byte的16进制数

<test></test>

<test>0x14223344</test>

原文地址:https://www.cnblogs.com/harlanc/p/5220843.html