- //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);
- //该片段来自于http://www.codesnippet.cn/detail/291020136781.html
来源: http://www.codesnippet.cn/detail/291020136781.html