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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(?=[^&])(?:(?<scheme>[^:/?#]+):)?(?://(?<authority>[^/?#]*))?(?<path>[^?#]*)(?:\?(?<query>[^#]*))?(?:#(?<fragment>.*))?
Description
Use it for breaking-down a URI (URL, URN) reference into its main components: Scheme, Authority, Path, Query and Fragment. This is not a simple match regular expression. so it not works to verify a URI. It returns 1 matching group for each URI component. For example, for the following URI: http://regexlib.com/REDetails.aspx?regexp_id=x#Details returns: scheme=&quot;http&quot;, authority=&quot;regexlib.com&quot;, path=&quot;/REDetails.aspx&quot;, query=&quot;regexp_id=x&quot; and fragment=&quot;Details&quot;. This is a W3C raccomandation (RFC 2396).
Matches
http://regexlib.com/REDetails.aspx?regexp_id=x#Details
Non-Matches
&
Author Rating: Not yet rated. Frederico Knabben
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

Title: life is good
Name: lovemary
Date: 7/31/2012 5:42:21 PM
Comment:
Hello, how are you doing today? i hope all is well with you. Am miss Lovemary james.Humble and Honest, please i saw your lovely profile here in datemyfamily.com and i became very much interested in you to know you more and I'm seeking of a reliable, affectionate for a real love relationship .please Reply me in my email ( [email protected] ) So that i will give you my picture for you to me better and for us to come together as a one divine family.Please I am waiting impatiently to hear from your lovely mail soonest (Remember the distance, Age o color does not matter but love matters allot in a True love relationship)have an endless special day & joyful moment and Be bless for me Lovemary


Title: This is not a W3C recommendation!
Name: reeaal
Date: 5/28/2011 2:32:38 PM
Comment:
The regex mentioned in RFC 2396 is the following: ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? You may, exclude some unnecessary back-references like this: ^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?


Title: Not satisfactory
Name: Mark Ayers
Date: 11/2/2004 6:44:07 PM
Comment:
This expression does not perform as described.


Title: Matches empty string
Name: Dave
Date: 1/13/2004 7:30:17 PM
Comment:
This regex matches the empty string so it is not useful for finding URLs and it is not useful for validating URLs


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