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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(?<link>((?<prot>http:\/\/)*(?<subdomain>(www|[^\-\n]*)*)(\.)*(?<domain>[^\-\n]+)\.(?<after>[a-zA-Z]{2,3}[^>\n]*)))$
Description
I wrote this after I couldn't find an expression that would search for valid URLs, whether they had HTTP in front or not. This will find those that don't have hyphens anywhere in them (except for after the domain).
Matches
http://www.google.com | www.123google.com | www.google.com/help/me
Non-Matches
-123google.com | http://-123.123google.com
Author Rating: Not yet rated. Joe Pontani
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

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