我正在为我的XML验证最终编写一个模式,并最终得到了所有(几乎)工作.但现在我在XML中遇到了最奇怪的错误.我将首先展示我的架构,因为问题应该在哪里,但它没有给我任何错误.
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:os="OrdersSchema"
targetNamespace="OrdersSchema"
elementFormDefault="unqualified"
attributeFormDefault="qualified">
<element name="orders" type="os:orders"/>
<complexType name="orders">
<sequence>
<element name="order" type="os:order" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="order">
<sequence>
<element name="deliveryAddress">
<complexType>
<sequence>
<element name='line1' type='os:lineType'/>
<element name='line2' type='os:lineType'/>
<element name='line3' type='os:lineType'/>
<element name='line4' type='os:lineType' minOccurs='0'/>
</sequence>
<attribute name="orderId" type="string" use="required" >
</attribute>
<attribute name="type" type="os:typeType" use="required"/>
</complexType>
<unique name="uniqueOrderIdPerOrder">
<selector xpath="os:order"/>
<field xpath="orderId"/>
</unique>
</element>
<element name='items'>
<complexType>
<attribute name='productId' type='os:productIdType'/>
<attribute name='quantity'>
<simpleType>
<restriction base='positiveInteger'>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
<element name='note' minOccurs='0' …Run Code Online (Sandbox Code Playgroud) 我很擅长bash脚本.我正在尝试计算出来,而我特别想要做的是编写一个允许我输入参数的脚本,并且我的脚本计算出该参数的2的幂.
所以说我会尝试
bash scriptname 3
Run Code Online (Sandbox Code Playgroud)
我的脚本会计算 2^3=8
我正在尝试
(( 2 ^ $1 ))
Run Code Online (Sandbox Code Playgroud)
但那没有做任何事情.是否有命令来计算我不知道的东西的力量?
我是Regex的新手,刚开始在学校学习它.我得到了我的第一个任务,并且相当顺利.
让我解释一下,我的代码是有道理的...分配是让我的.NET Regex Tester通过文本搜索密码.这些密码不能包含任何空格(所以我用过\S)不能以数字或者下划线开头,所以我用的是(?m:^([^_|^0-9]{1})
不能以两个不同的字符结束
(?<finalTwo>(?i:\S{1}))(?i:\<finalTwo>)
Run Code Online (Sandbox Code Playgroud)
必须包含至少一个数字,所以我使用了前瞻.现在,问题在于,代码现在是一个非常混乱的事情.
(?=.*\d)(?m:^([^_|^0-9]{1})(\S*)(?<finalTwo>(?i:\S{1}))(?i:\<finalTwo>))
Run Code Online (Sandbox Code Playgroud)
我还要添加一件事,密码长度必须在8到20个字符之间.我知道我必须使用{8,20}(我认为),但问题是,无论我在哪里输入它,它都完全杀死了搜索.
有没有人知道如何解决这个问题?
非常感激.