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="http", authority="regexlib.com", path="/REDetails.aspx", query="regexp_id=x" and fragment="Details".
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 |
|
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