minOccurs정규식을 사용하여 한 줄 내의 단어 무시
<xs:element[^>]+?\sminOccurs\s*=[^>]+>
및이 텍스트가 포함 된 줄과 일치하는이식이 주어집니다.
<xs:element name="shipto">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" minOccurs="1" type="xs:string"/>
<xs:element name="country" minOccurs="1" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
xs : element - xs : 요소에는 minOccurs가 포함되지 않습니다.
예상되는 출력은 다음과 같습니다.
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
당신이 요구 한대로 _exactly_ 할 일 것이다 XML을 구문 분석 정규식 대신 XML 파서를 사용. –