We having a HTML content like
<em></ em >
<font style="text-align:justify;">aaaaaaaaaaa</font>
<img src="abc.jpg"/>
<iframe src="somelink.com">
</iframe>
<br>
<br/>
We want to change all HTML Tags to <p></p>
but do not change the <img/>
and <br/>
tag, some <br/>
tags may display <br>
so, the following is our expected result:
<p></p>
<p>aaaaaaaaaaa</p>
<img src="abc.jpg"/>
<p>
</p>
<br>
<br/>
My regular expression like (in C#):
String result = Regex.Replace(content, @"<[^/b>]*>", "<p>");
result = Regex.Replace(result, @"</[^>]*>", "</p>");
but it can't skip the certain tags, please help me, thanks !