Published in: PHP
This regular expression matches a URL.
https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)? PHP Example: Automatically link URL's inside text. $text = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $text);
You need to login to post a comment.
