...

View Full Version : cant figure out how to add file:// for link validation



V@no.
04-02-2003, 02:43 PM
Hi!
I have two pre_match codes, both works only for http and https
and because of lack of regular expressions knowlege I cant figure out how to add file:// and ftp:// to it.
here is my two code lines:
preg_match("/^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+/i", $url)
and

preg_match("#^(https?:\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)*[a-z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is", $remote_thumb_file)
can someone help me with that?
thx.

bored
04-02-2003, 04:43 PM
preg_match("/^(http|https|ftp|ftps|file|gopher|telnet|or|anything|else|you|would|want|to|look|for)?\:\/\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+/i", $url)

V@no.
04-03-2003, 03:28 PM
thx for the reply, but it didnt work...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum