How to match bare urls with regex in PHP? -



How to match bare urls with regex in PHP? -

$bits = preg_split('#((?:https?|ftp)://[^\s\'"<>()]+)#s', $token->data, -1, preg_split_delim_capture);

say,i'm trying match urls need linkified.the above permissive.

i want match simple urls http://google.com, not <a href="http://google.com">http://google.com</a>, or <iframe src="http://google.com"></iframe>

it appears you're trying parse html using regular expressions. you might want rethink that.

php regex url

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -