Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 允许XSD中除#和$之外的所有字符_Regex_Xsd_Special Characters - Fatal编程技术网

Regex 允许XSD中除#和$之外的所有字符

Regex 允许XSD中除#和$之外的所有字符,regex,xsd,special-characters,Regex,Xsd,Special Characters,我们要求允许XSD元素使用除#、$和空格之外的所有字符(包括特殊字符) 我尝试了正则表达式作为[^$\s]*,但没有成功。你能帮我解决这个问题吗?我不知道。我在XSD中试用了你的正则表达式,它可以正常工作 <?xml version="1.0" encoding="utf-16"?> <xs:schema xmlns="http://Scratch.SO53903548" targetNamespace="http://Scratch.SO53903548" xmlns:xs=

我们要求允许XSD元素使用除#、$和空格之外的所有字符(包括特殊字符)


我尝试了正则表达式作为
[^$\s]*
,但没有成功。你能帮我解决这个问题吗?我不知道。我在XSD中试用了你的正则表达式,它可以正常工作

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Scratch.SO53903548" targetNamespace="http://Scratch.SO53903548" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Root">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="SpecialString2">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:pattern value="[^$#\s]*" />
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

将非常高兴地验证以下内容,但在$、#或空格上失败


thequickbrownfoxjumpedoverthelazydog@THEQUICKBROWNFOXJUMPEDOVERTHELAZYDOG!~`@%^&*()-_+=

它是如何不起作用的?我刚试了一下,结果正如预期的那样。在数据中是否还有其他像CR LF这样的空白应该被允许?
<ns0:Root xmlns:ns0="http://Scratch.SO53903548">
 <SpecialString2>thequickbrownfoxjumpedoverthelazydog@THEQUICKBROWNFOXJUMPEDOVERTHELAZYDOG!~`@%^&amp;*()-_+=</SpecialString2>
</ns0:Root>