Hello, I have the following code that unlinks all of the links in the string. How can I specify it to remove only the links with the http://law.mysite.com/attorneys/david-airan URL? So in this example Google will still be linked. Thanks
I would expect that you’d extend the starting-specification
'/<a href=\"
to include the links on your own site, but I’m not sure of the syntax and how you might have to escape any characters. I read that as searching for a string that starts with the open-href link as far as the opening double-quote, so you need to extend that to also include your domain, so something like
'/<a href=\"http://law.mysite.com
would be needed to match anything starting with your domain. But I don’t know if you have to escape the forward-slashes, full-stops and so on. And that would only work for your specific example, to unlink stuff that specifically matches your domain - I imagine there’s a way to unlink any link that isn’t Google, if that’s what you meant.