I have this expression:
$content = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1" target="_blank">$1</a>', $content);
But a link like
http://photoartkalmar.com/Photoart%20Kalmar%20high%20res/Gigapixel/Vienna%2050%20Gigapixel/Donauturm.html
or that ends with something.jpg
The anchor link stops at % or . on the urls, so it doesnt make it all a link only half of it. How can i fix this?