#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    75
    Rep Power
    11

    Checking for a valid url


    Does anyone have a good regex for checking a user submitted url?

    I would like to just ensure that the format does not have the http:// and that it somewhat resembles a valid url.

    I will manually be clicking on the links myself to ensure they work but really want to keep the bad data out.

    Any help is truly appreciated as I am lost.

    Thanks

    CH...
  2. #2
  3. No Profile Picture
    User 165270
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2005
    Posts
    497
    Rep Power
    937
    Originally Posted by CoolHand
    Does anyone have a good regex for checking a user submitted url?

    I would like to just ensure that the format does not have the http:// and that it somewhat resembles a valid url.

    ...
    Code:
    ^[^.]+(\.[^.]+)+(/[^/]*)*$

IMN logo majestic logo threadwatch logo seochat tools logo