Help with a preg_replace

JohnBrown

New Member
I'm trying to convert URLs, but not if they come after src="http://stackoverflow.com/questions/3655106/. So far, I have this...\[code\]return preg_replace('@(?!^src="http://stackoverflow.com/questions/3655106/)(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.-]*(\?\S+)?)?)?)@', '<a href="http://stackoverflow.com/questions/3655106/$1" target="_blank">$1</a>', $s);\[/code\]It converts the URL, but even if it is before src="http://stackoverflow.com/questions/3655106/
 
Back
Top