<?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: Split URLs in JavaScript</title>
	<atom:link href="http://blog.stevenlevithan.com/archives/parseuri-split-url/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.stevenlevithan.com/archives/parseuri-split-url</link>
	<description>A JavaScript and regular expression centric blog</description>
	<lastBuildDate>Wed, 08 Sep 2010 23:20:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Corey</title>
		<link>http://blog.stevenlevithan.com/archives/parseuri-split-url/comment-page-1#comment-42769</link>
		<dc:creator>Corey</dc:creator>
		<pubDate>Fri, 30 Oct 2009 18:55:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/?p=13#comment-42769</guid>
		<description>Thanks, this is a great javascript url parser!</description>
		<content:encoded><![CDATA[<p>Thanks, this is a great javascript url parser!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: name</title>
		<link>http://blog.stevenlevithan.com/archives/parseuri-split-url/comment-page-1#comment-39312</link>
		<dc:creator>name</dc:creator>
		<pubDate>Wed, 29 Jul 2009 07:27:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/?p=13#comment-39312</guid>
		<description>What is it,</description>
		<content:encoded><![CDATA[<p>What is it,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blog.stevenlevithan.com/archives/parseuri-split-url/comment-page-1#comment-35</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 25 Apr 2007 15:52:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/?p=13#comment-35</guid>
		<description>@josh

JavaScript doesn&#039;t support named capturing groups. I&#039;m assigning names to each part by mapping names from the uriPartNames array to the array of backreferences returned by the RegExp.exec() method. Parentheses are used to capture the backreferences, but not all of the parentheses are part of capturing groups.

As for your task, there are some cases you might not be thinking about. E.g., how would &quot;www.google.co.uk&quot;, &quot;64.233.287.99&quot;, or something like &quot;localhost&quot; be handled? By the way, the top-level domain (TLD) from your example would be &quot;com&quot;, not &quot;google.com&quot;.</description>
		<content:encoded><![CDATA[<p>@josh</p>
<p>JavaScript doesn&#8217;t support named capturing groups. I&#8217;m assigning names to each part by mapping names from the uriPartNames array to the array of backreferences returned by the RegExp.exec() method. Parentheses are used to capture the backreferences, but not all of the parentheses are part of capturing groups.</p>
<p>As for your task, there are some cases you might not be thinking about. E.g., how would &#8220;www.google.co.uk&#8221;, &#8220;64.233.287.99&#8243;, or something like &#8220;localhost&#8221; be handled? By the way, the top-level domain (TLD) from your example would be &#8220;com&#8221;, not &#8220;google.com&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: josh</title>
		<link>http://blog.stevenlevithan.com/archives/parseuri-split-url/comment-page-1#comment-34</link>
		<dc:creator>josh</dc:creator>
		<pubDate>Tue, 24 Apr 2007 20:04:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/?p=13#comment-34</guid>
		<description>Thanks Steve for a very useful function. There is one thing I&#039;d like to do with this function, and I&#039;m not sure how to do it - I need to split the hostname further, and only retain the TLD portion. So I would match google.com in mail.google.com and google.com and www.google.com. My psuedo regex for this would be [optional some characters including dots][some characters without dots].com. The first portion I wouldn&#039;t need access to. The second portion I would. I&#039;m not quite sure how to express this in real regex, in particular it&#039;s not clear how to indicate that a piece of a match should be &quot;named&quot;. Is it parens? Anyway, any tips you could give on this would be great. FYI I need to write this function so I can set cookies via Javascript that can be set in one subdomain and read in another. According to &lt;a href=&quot;http://www.w3.org/Protocols/rfc2109/rfc2109.txt&quot; rel=&quot;nofollow&quot;&gt;the rfc for cookies&lt;/a&gt; you should be able to set the Domain attribute to the TLD portion, prepending a dot, and that cookie will be sent by the browser to subdomains.</description>
		<content:encoded><![CDATA[<p>Thanks Steve for a very useful function. There is one thing I&#8217;d like to do with this function, and I&#8217;m not sure how to do it &#8211; I need to split the hostname further, and only retain the TLD portion. So I would match google.com in mail.google.com and google.com and <a href="http://www.google.com" rel="nofollow">http://www.google.com</a>. My psuedo regex for this would be [optional some characters including dots][some characters without dots].com. The first portion I wouldn&#8217;t need access to. The second portion I would. I&#8217;m not quite sure how to express this in real regex, in particular it&#8217;s not clear how to indicate that a piece of a match should be &#8220;named&#8221;. Is it parens? Anyway, any tips you could give on this would be great. FYI I need to write this function so I can set cookies via Javascript that can be set in one subdomain and read in another. According to <a href="http://www.w3.org/Protocols/rfc2109/rfc2109.txt" rel="nofollow">the rfc for cookies</a> you should be able to set the Domain attribute to the TLD portion, prepending a dot, and that cookie will be sent by the browser to subdomains.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blog.stevenlevithan.com/archives/parseuri-split-url/comment-page-1#comment-33</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 27 Mar 2007 05:55:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/?p=13#comment-33</guid>
		<description>@Scott:

No, it makes no such assumption. It simply splits the URI in the most logical way according to its rules. See my note on how this function intentionally does not attempt to validate the URIs it receives.</description>
		<content:encoded><![CDATA[<p>@Scott:</p>
<p>No, it makes no such assumption. It simply splits the URI in the most logical way according to its rules. See my note on how this function intentionally does not attempt to validate the URIs it receives.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
