0

Say I have a piece of XML like

<parent>
    <A>
        <id>1</id>
        <property></property>
    </A>
    <B>
        <id>2</id>
        <property></property>
    </B>
    <C>
        <id>3</id>
        <property></property>
    </C>
</parent>

I want to match each of the child nodes under parent node which has an id node. e.g.A,B and C node Would it be possible using a regexp to do the job instead of parsing the whole document tree?

Thanks for help =)

  • Im using Java but I think it should not matter which scripting language Im using since we are talking about regexp. =) – user1038662 Dec 07 '14 at 07:40
  • Don't parse html with regex https://regex101.com/r/jR0bK9/3 . – Avinash Raj Dec 07 '14 at 07:42
  • [You can't parse html with regex!](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454) – Tim B Dec 07 '14 at 08:43

0 Answers0