내 가치를 다시 반환정규식 내가 XML의 샘플 세트를 태그
<rsp stat="ok">
<site>
<id>1234</id>
<name>testAddress</name>
<hostname>anotherName</hostname>
...
</site>
<site>
<id>56789</id>
<name>ba</name>
<hostname>alphatest</hostname>
...
</site>
</rsp>
내가 <name></name>
내에서 모든 것을 추출 할 수 있지만 태그 자체가, 그리고 가지고 그 첫 번째 예를 들어 (또는 다른 테스트를 기반으로 어떤 항목을 선택하십시오).
정규식에서 가능합니까?
해당 언어로 xml 파싱 라이브러리를 사용할 수 있습니까? regex에서는 가능하지만 XML 라이브러리를 사용하는 것이 훨씬 쉽고 효율적입니다. – Bartek
또한 http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 – voyager