<?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: URL parsing and manipulation in .NET</title>
	<atom:link href="http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net/feed" rel="self" type="application/rss+xml" />
	<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=url_parsing_and_manipulation_in_net</link>
	<description>A .NET developer in silicon valley</description>
	<lastBuildDate>Sun, 25 Dec 2011 15:10:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Damien Guard</title>
		<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net#comment-39736</link>
		<dc:creator>Damien Guard</dc:creator>
		<pubDate>Sun, 11 Apr 2010 05:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/archive/2006/07/07/url_parsing_and_manipulation_in_net.aspx#comment-39736</guid>
		<description>It&#039;s a good solution for general parsing operations even in a server environment where you want to do things like manipulate page parameters etc. (which is what it was originally designed for)

Any regex based parsing will be less well performing than a hand-coded parser - this applies to any parsing not just this one or url parsing.

[)amien</description>
		<content:encoded><![CDATA[<p>It&#8217;s a good solution for general parsing operations even in a server environment where you want to do things like manipulate page parameters etc. (which is what it was originally designed for)</p>
<p>Any regex based parsing will be less well performing than a hand-coded parser &#8211; this applies to any parsing not just this one or url parsing.</p>
<p>[)amien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net#comment-39735</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Sun, 11 Apr 2010 05:08:52 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/archive/2006/07/07/url_parsing_and_manipulation_in_net.aspx#comment-39735</guid>
		<description>I&#039;ve been collecting versions of different solutions that parse URLS and unfortunately, this one is by far the worst performing solution. Uri for all its weaknesses can process a million encode/decodes in about .4 seconds in my test environment. The second best solution which breaks more out than yours here is about 3 times slower than that but its versatile but I&#039;m looking for something better performing still. But the regex solution above takes about a minute to process a million encode/decodes. That tracks to about 142 times slower. Sorry. Regex is a poor solution for parsing on the serverside.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been collecting versions of different solutions that parse URLS and unfortunately, this one is by far the worst performing solution. Uri for all its weaknesses can process a million encode/decodes in about .4 seconds in my test environment. The second best solution which breaks more out than yours here is about 3 times slower than that but its versatile but I&#8217;m looking for something better performing still. But the regex solution above takes about a minute to process a million encode/decodes. That tracks to about 142 times slower. Sorry. Regex is a poor solution for parsing on the serverside.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guitarpoet</title>
		<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net#comment-17451</link>
		<dc:creator>guitarpoet</dc:creator>
		<pubDate>Mon, 18 May 2009 06:55:54 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/archive/2006/07/07/url_parsing_and_manipulation_in_net.aspx#comment-17451</guid>
		<description>Hello, I think the code has a bug and I had rewrite it like this:
private const string urlDecodeRegex = @&quot;([^:]+)://(([^:@]+)(:([^@]+))?@)?([^:/?#]+)(:([\d]+))?([^?#]+)?(\?([^#]+))?(#(.*))?&quot;;</description>
		<content:encoded><![CDATA[<p>Hello, I think the code has a bug and I had rewrite it like this:<br />
private const string urlDecodeRegex = @&#8221;([^:]+)://(([^:@]+)(:([^@]+))?@)?([^:/?#]+)(:([\d]+))?([^?#]+)?(\?([^#]+))?(#(.*))?&#8221;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ziv Rozzbach</title>
		<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net#comment-9578</link>
		<dc:creator>Ziv Rozzbach</dc:creator>
		<pubDate>Sun, 05 Oct 2008 15:00:33 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/archive/2006/07/07/url_parsing_and_manipulation_in_net.aspx#comment-9578</guid>
		<description>Nice, but it does not do one thing: splitting the host from the domain
so if I enter reag123.afsda123.ukdomain.co.uk it will return me: ukdomain.co.uk

Anyone have any idea how can I do it ?</description>
		<content:encoded><![CDATA[<p>Nice, but it does not do one thing: splitting the host from the domain<br />
so if I enter reag123.afsda123.ukdomain.co.uk it will return me: ukdomain.co.uk</p>
<p>Anyone have any idea how can I do it ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MrToes</title>
		<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net#comment-8461</link>
		<dc:creator>MrToes</dc:creator>
		<pubDate>Mon, 12 May 2008 16:09:24 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/archive/2006/07/07/url_parsing_and_manipulation_in_net.aspx#comment-8461</guid>
		<description>It&#039;s also remarkably intolerant of syntax problems. There&#039;s also a problem with the Uri class (in .NET 2.0 Compact Framework at least) where creating it with a string that has leading spaces causes memory corruption. Lovely. We have our own Uri class to fix this (and other) problems. Backward slashes resulting in FormatExceptions is another one that comes to mind. Quite possibly all this is fixed in new shiny .NET versions.

So, how long is it till V-day? :)</description>
		<content:encoded><![CDATA[<p>It&#8217;s also remarkably intolerant of syntax problems. There&#8217;s also a problem with the Uri class (in .NET 2.0 Compact Framework at least) where creating it with a string that has leading spaces causes memory corruption. Lovely. We have our own Uri class to fix this (and other) problems. Backward slashes resulting in FormatExceptions is another one that comes to mind. Quite possibly all this is fixed in new shiny .NET versions.</p>
<p>So, how long is it till V-day? :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damien Guard</title>
		<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net#comment-8394</link>
		<dc:creator>Damien Guard</dc:creator>
		<pubDate>Sat, 03 May 2008 10:34:48 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/archive/2006/07/07/url_parsing_and_manipulation_in_net.aspx#comment-8394</guid>
		<description>Thanks for spotting and figuring that out Ross - I must have broken it during the reformatting exercise when I switched to this theme.

[)amien</description>
		<content:encoded><![CDATA[<p>Thanks for spotting and figuring that out Ross &#8211; I must have broken it during the reformatting exercise when I switched to this theme.</p>
<p>[)amien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ</title>
		<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net#comment-8388</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Fri, 02 May 2008 17:02:32 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/archive/2006/07/07/url_parsing_and_manipulation_in_net.aspx#comment-8388</guid>
		<description>I found the problem, it&#039;s in the regular expression.. Here&#039;s the new line.

private const string urlDecodeRegex = @&quot;([^:]+)://(([^:@]+)(:([^@]+))?@)?([^:/?#]+)(:([d]+))?([^?#]+)?(\?([^#]+))?(#(.*))?&quot;;</description>
		<content:encoded><![CDATA[<p>I found the problem, it&#8217;s in the regular expression.. Here&#8217;s the new line.</p>
<p>private const string urlDecodeRegex = @&#8221;([^:]+)://(([^:@]+)(:([^@]+))?@)?([^:/?#]+)(:([d]+))?([^?#]+)?(\?([^#]+))?(#(.*))?&#8221;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ</title>
		<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net#comment-8387</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Fri, 02 May 2008 16:52:15 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/archive/2006/07/07/url_parsing_and_manipulation_in_net.aspx#comment-8387</guid>
		<description>This works well, but any attempts that I make to use an imported query string dont seem to work. I can build a querystring and export ok, but importing one fails.

Is there a download of this as a .cs class file?</description>
		<content:encoded><![CDATA[<p>This works well, but any attempts that I make to use an imported query string dont seem to work. I can build a querystring and export ok, but importing one fails.</p>
<p>Is there a download of this as a .cs class file?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damien Guard</title>
		<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net#comment-8221</link>
		<dc:creator>Damien Guard</dc:creator>
		<pubDate>Fri, 11 Apr 2008 09:56:33 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/archive/2006/07/07/url_parsing_and_manipulation_in_net.aspx#comment-8221</guid>
		<description>@Mike: Well you could but if that&#039;s all you want you may as well just grab the string up to the final / with  urlString.Substring(0,urlString.LastIndexOf(&#039;/&#039;)-1)

[)amien</description>
		<content:encoded><![CDATA[<p>@Mike: Well you could but if that&#8217;s all you want you may as well just grab the string up to the final / with  urlString.Substring(0,urlString.LastIndexOf(&#8216;/&#8217;)-1)</p>
<p>[)amien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://damieng.com/blog/2006/07/07/url_parsing_and_manipulation_in_net#comment-6866</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 18 Mar 2008 02:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/archive/2006/07/07/url_parsing_and_manipulation_in_net.aspx#comment-6866</guid>
		<description>If I had this: http://damieng.com/blog/2006/07/07/URL_parsing_and_manipulation_in_NET

How could I get just this part?
http://damieng.com/blog/2006/07/07</description>
		<content:encoded><![CDATA[<p>If I had this: <a href="http://damieng.com/blog/2006/07/07/URL_parsing_and_manipulation_in_NET" rel="nofollow">http://damieng.com/blog/2006/07/07/URL_parsing_and_manipulation_in_NET</a></p>
<p>How could I get just this part?<br />
<a href="http://damieng.com/blog/2006/07/07" rel="nofollow">http://damieng.com/blog/2006/07/07</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

