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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find URL Parsing Regex
Expression
(?<protocol>http(s)?|ftp)://(?<server>([A-Za-z0-9-]+\.)*(?<basedomain>[A-Za-z0-9-]+\.[A-Za-z0-9]+))+((/?)(?<path>(?<dir>[A-Za-z0-9\._\-]+)(/){0,1}[A-Za-z0-9.-/]*)){0,1}
Description
This regex matches fully qualified external urls (http, https, or ftp). It uses the ms specific group-naming structure to present friendly named groups back to the user.
Matches
http://www.myserver.mydomain.com/myfolder/mypage.aspx
Non-Matches
www.myserver.mydomain.com/myfolder/mypage.aspx
Author Rating: The rating for this expression. Scott Sargent
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-2024, RegexAdvice.com | ASP.NET Tutorials