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 URL Parsing
Expression
(?:(?<scheme>[a-zA-Z]+)://)?(?<domain>(?:[0-9a-zA-Z\-_]+(?:[.][0-9a-zA-Z\-_]+)*))(?::(?<port>[0-9]+))?(?<path>(?:/[0-9a-zA-Z\-_.]+)+)(?:[?](?<query>.+))?
Description
Separates a URL into components viz. schema, domain, port, path and query. Avoids unnecessary numbered groups caused by braces.
Matches
http://www.google.com/cgi/search?hl=en&q=RegEx+Library&btnG=Google+Search&meta= | ftp://ftp.google.com:21/Files/Data.zip | http://www.google.com:80/cgi/search?hl=en&q=RegEx+Library&btnG=Google+Search&meta=
Non-Matches
http:/www.google.co.za:80/cgi/search?hl=en&q=RegEx+Library&btnG=Google+Search&meta= | http://www.google.co.za?80/cgi/search?hl=en&q=RegEx+Library&btnG=Google+Search&meta= | http://www.google.co.za:80/cgi/search/hl=en&q=RegEx+Library&btnG=Google+Search&meta=
Author Rating: Not yet rated. Raje
   Displaying page 1 of 1 pages; Items 1 to 1

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