Help please to make from the string like:
<a href="http://testsite.com" class="className">link_text_part1 <em>another_text</em> link_text_part2</a>
string like:
link_text_part1 another_text link_text_part2
using regular expressions in Python
!note testsite.com changes
So you want to remove the
<a>and<em>tags? That can be done like this:In English, this searches for:
and replaces them with empty strings.
However as Kos says, using regex to parse HTML is highly risky and fragile, unless you know that the format of the HTML you are parsing will never change.