Title: Use replace
Date: 1/7/2016 1:58:40 PM
Use replace. This matches any tag that is not in the list, as described. So replace any match with an empty string to remove tags that are not <a> or <img>. But you can add any tagname you wish with or pipe delimiters. e.g. (a|i|b|strong)
Title: Seems to do the opposite
Name: Neil McLeish
Date: 1/4/2012 5:13:45 AM
I hav etried this and the tags which got stripped from my source were the anchor tags.
This regex therefore, seems to do the exact opposite of its decription.