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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(?<url> (?<protocol> http(s?) | ftp )\:\/\/ (?<host> (?<hostname> ( (?<subdomain> ([a-z]\w*\.)*[a-z]\w* )\. )? ( (?<ip> (\d{1,3}\.){3}\d{1,3} ) | ( (?<org> [a-z]\w* )\. (?<domain> [a-z]{2,3} ) ) ) )? (\: (?<port> \d+ ) )? ) (?<path> (?<directory> (\/.*)*\/ )? (?<file> [a-z]\w*\.\w+ )? )? (\# (?<hash> [^?\n\r]+ ) )? (\? (?<search> (\&?[^\=\n\r]+\=[^\&\n\r]*)+ ) )? )
Description
Thanks to Ariel Merrell, as well as the folks who developed the javascript location object for some of the inspiration for this. This was intended primarily to help break down the parts of a URL for easier processing, and not as a validator. Please make sure the following options are met - .Net RE - Case Insensitive - Ignore pattern whitespace - Explicit Capture.
Matches
https://MySubDomain.123.0.0.1:443/MyDir/MySubDir/MyFile.html#MyHash?q=5%432&q2=paramval | http:/
Non-Matches
SomeDomain.com
Author Rating: Not yet rated. Chris Strolia-Davis
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