Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Feb 2003
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question cant figure out how to add file:// for link validation

    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:
    Code:
    preg_match("/^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+/i", $url)
    and
    Code:
    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.

  • #2
    New Coder
    Join Date
    Jan 2003
    Location
    Tulsa, OK
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    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)
    Last edited by bored; 04-02-2003 at 04:46 PM.

  • #3
    Regular Coder
    Join Date
    Feb 2003
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx for the reply, but it didnt work...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •