I have some links like this:
legal
I want to remove all links that does not have "legallink.com" in it. But still keep the content. So the above input would output:
legal
It should work recursively through the links.
I found this regex that removes all links: /<\\/?a(\\s+.*?>|>)/
, but I want it to keep links where href is legallink.com.
Can this be done with regex? Or should I use a DOM parser?
No comments:
Post a Comment