<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: parseUri 1.2: Split URLs in JavaScript</title>
	<atom:link href="http://blog.stevenlevithan.com/archives/parseuri/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.stevenlevithan.com/archives/parseuri</link>
	<description>A JavaScript and regular expression centric blog</description>
	<lastBuildDate>Thu, 02 Feb 2012 02:09:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Norbert Klasen</title>
		<link>http://blog.stevenlevithan.com/archives/parseuri/comment-page-2#comment-176787</link>
		<dc:creator>Norbert Klasen</dc:creator>
		<pubDate>Thu, 12 Jan 2012 08:49:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/parseuri#comment-176787</guid>
		<description>Hi,

I&#039;ve enhanced the loose mode a bit to support and tokenize literal IPv4 and IPv6 addresses as well as splitting an FQDN into hostname and domain.

Thanks
Norbert

String.prototype.parseUri = function() {
	var o = String.prototype.parseUri.options;
	var m = o.parser.ipv6.exec(this);
	var uri = {};
	var i = 18;
	while (i--)
		uri[o.key[i]] = m[i] &#124;&#124; &quot;&quot;;

	uri[o.q.name] = {};
	uri[o.key[16]].replace(o.q.parser, function($0, $1, $2) {
		if ($1)
			uri[o.q.name][$1] = $2;
	});

	if (uri.ipv4 != &quot;&quot;) {
		uri.ip = uri.ipv4;
	}
	else
		if (uri.ipv6 != &quot;&quot;) {
			uri.ip = uri.ipv6;
		}

	return uri;
};

String.prototype.parseUri.options = {
	// strictMode : false,
	key : [ &quot;source&quot;, &quot;protocol&quot;, &quot;authority&quot;, &quot;userInfo&quot;, &quot;user&quot;, &quot;password&quot;,
			&quot;host&quot;, &quot;ipv4&quot;, &quot;ipv6&quot;, &quot;basename&quot;, &quot;domain&quot;, &quot;port&quot;, &quot;relative&quot;,
			&quot;path&quot;, &quot;directory&quot;, &quot;file&quot;, &quot;query&quot;, &quot;anchor&quot; ],
	q : {
		name : &quot;queryKey&quot;,
		parser : /(?:^&#124;&amp;)([^&amp;=]*)=?([^&amp;]*)/g
	},
	parser : {
		ipv6 : /^(?:(?![^:@]+:[^:@\/]*@)([^[:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:(\d+\.\d+\.\d+\.\d+)&#124;\[([a-fA-F0-9:]+)\]&#124;([^.:\/?#]*))(?:\.([^:\/?#]*))?)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]&#124;$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
	}
};</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;ve enhanced the loose mode a bit to support and tokenize literal IPv4 and IPv6 addresses as well as splitting an FQDN into hostname and domain.</p>
<p>Thanks<br />
Norbert</p>
<p>String.prototype.parseUri = function() {<br />
	var o = String.prototype.parseUri.options;<br />
	var m = o.parser.ipv6.exec(this);<br />
	var uri = {};<br />
	var i = 18;<br />
	while (i&#8211;)<br />
		uri[o.key[i]] = m[i] || &#8220;&#8221;;</p>
<p>	uri[o.q.name] = {};<br />
	uri[o.key[16]].replace(o.q.parser, function($0, $1, $2) {<br />
		if ($1)<br />
			uri[o.q.name][$1] = $2;<br />
	});</p>
<p>	if (uri.ipv4 != &#8220;&#8221;) {<br />
		uri.ip = uri.ipv4;<br />
	}<br />
	else<br />
		if (uri.ipv6 != &#8220;&#8221;) {<br />
			uri.ip = uri.ipv6;<br />
		}</p>
<p>	return uri;<br />
};</p>
<p>String.prototype.parseUri.options = {<br />
	// strictMode : false,<br />
	key : [ "source", "protocol", "authority", "userInfo", "user", "password",<br />
			"host", "ipv4", "ipv6", "basename", "domain", "port", "relative",<br />
			"path", "directory", "file", "query", "anchor" ],<br />
	q : {<br />
		name : &#8220;queryKey&#8221;,<br />
		parser : /(?:^|&amp;)([^&amp;=]*)=?([^&amp;]*)/g<br />
	},<br />
	parser : {<br />
		ipv6 : /^(?:(?![^:@]+:[^:@\/]*@)([^[:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:(\d+\.\d+\.\d+\.\d+)|\[([a-fA-F0-9:]+)\]|([^.:\/?#]*))(?:\.([^:\/?#]*))?)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/<br />
	}<br />
};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sosoflickr</title>
		<link>http://blog.stevenlevithan.com/archives/parseuri/comment-page-2#comment-168579</link>
		<dc:creator>sosoflickr</dc:creator>
		<pubDate>Mon, 26 Dec 2011 08:14:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/parseuri#comment-168579</guid>
		<description>great stuff.
thanks!</description>
		<content:encoded><![CDATA[<p>great stuff.<br />
thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hepsignman</title>
		<link>http://blog.stevenlevithan.com/archives/parseuri/comment-page-2#comment-141004</link>
		<dc:creator>hepsignman</dc:creator>
		<pubDate>Mon, 03 Oct 2011 13:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/parseuri#comment-141004</guid>
		<description>Newbie question.
We have a job application form that uses the document.referrer to identify which job they are applying for. And, I want to add this info into the subject line of the email sent to our hr person. I came across your code that will parse the url.
how do I take what your parser produces so I can add it to the subject line?</description>
		<content:encoded><![CDATA[<p>Newbie question.<br />
We have a job application form that uses the document.referrer to identify which job they are applying for. And, I want to add this info into the subject line of the email sent to our hr person. I came across your code that will parse the url.<br />
how do I take what your parser produces so I can add it to the subject line?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 84</title>
		<link>http://blog.stevenlevithan.com/archives/parseuri/comment-page-2#comment-133093</link>
		<dc:creator>84</dc:creator>
		<pubDate>Tue, 06 Sep 2011 03:06:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/parseuri#comment-133093</guid>
		<description>Hello...nice site...&lt;a href=&quot;http://blog.stevenlevithan.com/archives/parseuri&quot; rel=&quot;nofollow&quot;&gt;http://blog.stevenlevithan.com/archives/parseuri&lt;/a&gt; is The Best! Please keep it up webmaster....great job...thumbs up!</description>
		<content:encoded><![CDATA[<p>Hello&#8230;nice site&#8230;<a href="http://blog.stevenlevithan.com/archives/parseuri" rel="nofollow">http://blog.stevenlevithan.com/archives/parseuri</a> is The Best! Please keep it up webmaster&#8230;.great job&#8230;thumbs up!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://blog.stevenlevithan.com/archives/parseuri/comment-page-2#comment-120264</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 27 Jul 2011 12:02:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/parseuri#comment-120264</guid>
		<description>Can you remove the maxlength on the input box? Thanks.</description>
		<content:encoded><![CDATA[<p>Can you remove the maxlength on the input box? Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

