Regex: Strip HTML attributes except SRC
- by Ian Silber
Hi,
I'm trying to write a regular expression that will strip all tag attributes except for the SRC attribute. For example:
<p id="paragraph" class="green">This is a paragraph with an image <img src="/path/to/image.jpg" width="50" height="75"/></p>
Would be returned as:
<p>This is a paragraph with an image <img…