Hi people, I've been searching all over the net for the correct regex/command, but cant find anything..
file.xml
Code:
<koko value="92029">
<arnab>5</arnab>
<kambing>3</kambing>
</xoxo>
<xoxo value="13245">
<kambing>2</kambing>
<kambing>3</kambing>
</xoxo>
<popo value="12345">
<kambing>2</kambing>
<kambing>3</kambing>
</popo>
I would like to extract only a spesific tag, including its tag attribute. Eg:
Code:
<xoxo value="13245">
<kambing>2</kambing>
<kambing>3</kambing>
</xoxo>
I tried egrep before with this regex, but nothing came up.
Code:
egrep '<xoxo[\s\S]*?/xoxo>' file.xml
Currently Im working for a one line solution like sed or egrep. I heard awk could do too but regex is too difficult for me to understand. Any hint on the solution is pretty much appreciated.
Thanks,
Adam.