Match or Find html/xml Element using RegExp Regexp to find html/xml element
Here I want to find the html or xml element with id or without id attribute.
Sample html file:
<p class="txt-ni">Radiation absorbed dose to the red bone marrow, a critical organ in the therapy of differentiated thyroid carcinoma with I-131 (radioiodine), cannot be measured directly. As radioiodine concentration is comparable in blood and most organs (<a href="#bib5" id="bib_5">Kolbert <em>et al</em>. 2007</a>), and is believed to be similar in red marrow (<a href="#bib9" id="bib_9">Sgouros 2005</a>), the absorbed dose to the blood seems to be a good first-order approximation of the radiation absorbed dose to the hematopoietic system and a better means to quantify exposure from therapy than the total amount of activity administered.</p>
In this above sample is single line(without enter mark) and it contain two <a> tag now I want to find the each <a> to </a> separately.
Here I am used RegExp
“<a href="#([^"]*)" id="([^"]*)">(.*)</a>”
The above RegExp will math all the <a> tag in the line, I mean the above RegExp returen following mathch
<a href="#bib5" id="bib_5">Kolbert <em>et al</em>. 2007</a>), and is believed to be similar in red marrow (<a href="#bib9" id="bib_9">Sgouros 2005</a>
But I want to match each separately like below
1. <a href="#bib5" id="bib_5">Kolbert <em>et al</em>. 2007</a>
2. <a href="#bib9" id="bib_9">Sgouros 2005</a>
I hope you will understand my request
Note:
The element may also contain child element as <i>,<em>,<b>