I have a string in Rails that contains HTML. For example,
<p>01/28/2016 Green RED Horse!!123 456</p>
<a href="http://greenredhorse.com" style="margin-left:283px;margin-
top:50px;margin-bottom:150px;overflow:auto;position:absolute;">
<img alt="Logo" src="http://greenredhorse.com/images/icons/logo.png"
style="width:266px" /> </a>
<p>01/28/2017 RED Horse!!123 456</p>
How would I go about removing the link tag and everything between its beginning and end from the string?
The end result should look like this.
<p>01/28/2016 Green RED Horse!!123 456</p>
<p>01/28/2017 RED Horse!!123 456</p>
In short: How can I delete everything between <a
and </a>
inclusively. Without changing the rest of the string.