Hey guys I have a quick question I need to validate a url such as http://www.domain.com or http://tyler.subdomain.com It always needs to be in this format because it will insert into the database does any one have a javascript code they can give me fo this? I'm not famaliar with regexp like I am php and sql. basically what I'm trying to do is to make sure they insert with http://www.domain.com or http://subdomain.subdomain.com so it always goes in that format before insert into mysql because I'm going to check mysql before people sign up to make sure no duplicate domains go into the database? what would be the best way of doing this? Also http://www.domain.com/myfolder/ is aloud too, I just need to make sure http://www. is the url field when there signing up, but the problem is the sub domain, how would I do this?
Here is a simplified version, with a few fixes such as allowing hyphens in URLs ~^http://([a-z-]+\.){2,}[a-z]{2,6}/?$~i Code (markup): tdd, why aren't you allowing http://domain.com ? (without the www. )