I was trying to delete all opening a-tags from html-code using python and Regular Expressions.
Here is my problem: If the code looks like this:
html_code = """<a href="test.html">This</a> is an <a href="example.html">example</a>"""
And I will apply this:
re.sub("""<a href=".*">""", "", html_code)
the computer will delete everything except
example</a>
How can i just get rid of the first a-tag which is referencing to test.html using regular expressions? After this step I just want to get:
This</a> is an <a href="example.html">example</a>
Thank you so much in advance!
New contributor
Dideldumdei123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.