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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details 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
   Displaying page 1 of 1 pages; Items 1 to 1

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