Suppose I have a page like this :
Blalbalbalbalablbalbalbalba <a href='http://www.google.com/intl/xx-klingon/'>Google</a> Blalbalbalbalablbalbalbalba <a href='www.turbo10.com'>Turbo10</a> BLalbalbalbalbalablbalbalabl <a href='www.mysite.com?page=test&lang=en'>My site</a>
If i display this page in my browser, I want all the links, other than the links which are pointing to mysite.com, to open in a new window
I tried something several regular experssions, but can't figure it out.
Thanks for all the help !
Geez, after a couple of hours...
Anyway, here's my solution :
$strContent = preg_replace("/<a href=\"(http|ftp|https):\/\/(?!www.mysite.com)(.)\">/i","<a href=\"\1://\2\" target=\"_blank\">",$strContent);
Maybe it's helpfull for others