RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Clean Domain Name
Expression
^http\://www.[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}/$
Description
This regex only matches clean domain names. No path after. Ends in a forward slash. Starts with http://www. It is pretty slack on the TLD requiring a 2 or 3 letter ending. This part could be tightened up if you wanted to be restrict it to specific TLDs.
Matches
http://www.somedomain.co.uk/ | http://www.somedomain.com/ | http://www.dodgydomain.com.com/
Non-Matches
http://www.somedomain.co.uk/withpath.aspx | http://somedomainwithoutwww.co.uk | http://www.com/ | www.noprotocolprefix.com/ | https://www.secureprotocolprefix.com/ | http://www.notrailingslash.co.uk | HTTP://WWW.beginswithcaps.com/
Author Rating: Not yet rated. Matthew Harris
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: rs runescape gold
Name: www.GameGoldFactory.com
Date: 11/18/2012 11:17:32 PM
Comment:
www.GameGoldFactory.com is the best place to buy rs gold, runescape gold


Copyright © 2001-2014, RegexAdvice.com | ASP.NET Tutorials