<?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: .split(..) broken in IE</title>
	<atom:link href="http://blog.stchur.com/2007/03/28/split-broken-in-ie/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stchur.com/2007/03/28/split-broken-in-ie/</link>
	<description>If you don&#039;t expect too much from me, you might not be let down.</description>
	<lastBuildDate>Thu, 26 Jan 2012 08:23:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: sstchur</title>
		<link>http://blog.stchur.com/2007/03/28/split-broken-in-ie/comment-page-1/#comment-63943</link>
		<dc:creator>sstchur</dc:creator>
		<pubDate>Thu, 20 May 2010 16:03:09 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/28/split-broken-in-ie/#comment-63943</guid>
		<description>@Guillaume:  Glad it helped!</description>
		<content:encoded><![CDATA[<p>@Guillaume:  Glad it helped!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guillaume</title>
		<link>http://blog.stchur.com/2007/03/28/split-broken-in-ie/comment-page-1/#comment-63823</link>
		<dc:creator>Guillaume</dc:creator>
		<pubDate>Thu, 20 May 2010 09:11:05 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/28/split-broken-in-ie/#comment-63823</guid>
		<description>Good job and many thanks !!!
I tried to make a Javascript to transform last and first name (eg : john-peter ladybird to John-Peter Ladybird) with the split function. 
Everything was Ok under Firefox but old IE 6 transformed it to JohnPeterLadybird, because of this f...ing bug

So congratulations and many many thanks !
Merci ;)</description>
		<content:encoded><![CDATA[<p>Good job and many thanks !!!<br />
I tried to make a Javascript to transform last and first name (eg : john-peter ladybird to John-Peter Ladybird) with the split function.<br />
Everything was Ok under Firefox but old IE 6 transformed it to JohnPeterLadybird, because of this f&#8230;ing bug</p>
<p>So congratulations and many many thanks !<br />
Merci <img src='http://blog.stchur.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett Knights</title>
		<link>http://blog.stchur.com/2007/03/28/split-broken-in-ie/comment-page-1/#comment-6410</link>
		<dc:creator>Brett Knights</dc:creator>
		<pubDate>Wed, 26 Nov 2008 21:49:38 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/28/split-broken-in-ie/#comment-6410</guid>
		<description>Thanks for the example. 

I reworked your code some and the following was a little better than twice as fast for my test cases:

String.prototype.xSplit = function(_regEx){
   // Most browsers can do this properly, so let them -- they&#039;ll do it faster
  if (&#039;a~b&#039;.split(/(~)/).length === 3) { return this.split(_regEx); }

   if (!_regEx.global)
      { _regEx = new RegExp(_regEx.source, &#039;g&#039; + (_regEx.ignoreCase ? &#039;i&#039; : &#039;&#039;)); }

   // IE (and any other browser that can&#039;t capture the delimiter)
   // will, unfortunately, have to be slowed down
    var start = 0, arr=[];
    var result;
    while((result = _regEx.exec(this)) != null){
        arr.push(this.slice(start, result.index));
        if(result.length &gt; 1) arr.push(result[1]);
        start = _regEx.lastIndex;
    }
    if(start &lt; this.length) arr.push(this.slice(start));
    if(start == this.length) arr.push(&quot;&quot;); //delim at the end
    return arr;
};</description>
		<content:encoded><![CDATA[<p>Thanks for the example. </p>
<p>I reworked your code some and the following was a little better than twice as fast for my test cases:</p>
<p>String.prototype.xSplit = function(_regEx){<br />
   // Most browsers can do this properly, so let them &#8212; they&#039;ll do it faster<br />
  if (&#039;a~b&#039;.split(/(~)/).length === 3) { return this.split(_regEx); }</p>
<p>   if (!_regEx.global)<br />
      { _regEx = new RegExp(_regEx.source, &#039;g&#039; + (_regEx.ignoreCase ? &#039;i&#039; : &#034;)); }</p>
<p>   // IE (and any other browser that can&#039;t capture the delimiter)<br />
   // will, unfortunately, have to be slowed down<br />
    var start = 0, arr=[];<br />
    var result;<br />
    while((result = _regEx.exec(this)) != null){<br />
        arr.push(this.slice(start, result.index));<br />
        if(result.length &gt; 1) arr.push(result[1]);<br />
        start = _regEx.lastIndex;<br />
    }<br />
    if(start &lt; this.length) arr.push(this.slice(start));<br />
    if(start == this.length) arr.push(&#034;&#034;); //delim at the end<br />
    return arr;<br />
};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sstchur</title>
		<link>http://blog.stchur.com/2007/03/28/split-broken-in-ie/comment-page-1/#comment-1248</link>
		<dc:creator>sstchur</dc:creator>
		<pubDate>Tue, 22 Apr 2008 04:32:46 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/28/split-broken-in-ie/#comment-1248</guid>
		<description>Very nice!  Thanks Steven... I&#039;ll tuck that away for future reference. BTW, &quot;Flagrant Badassery&quot; is the coolest name for a blog ;-)</description>
		<content:encoded><![CDATA[<p>Very nice!  Thanks Steven&#8230; I&#039;ll tuck that away for future reference. BTW, &#034;Flagrant Badassery&#034; is the coolest name for a blog <img src='http://blog.stchur.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Levithan</title>
		<link>http://blog.stchur.com/2007/03/28/split-broken-in-ie/comment-page-1/#comment-1246</link>
		<dc:creator>Steven Levithan</dc:creator>
		<pubDate>Mon, 21 Apr 2008 19:44:15 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/28/split-broken-in-ie/#comment-1246</guid>
		<description>Here&#039;s an alternative approach to fixing this problem that you might find useful or interesting: &lt;a href=&quot;http://blog.stevenlevithan.com/archives/cross-browser-split&quot; rel=&quot;nofollow&quot;&gt;Fix JavaScript Split&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Here&#039;s an alternative approach to fixing this problem that you might find useful or interesting: <a href="http://blog.stevenlevithan.com/archives/cross-browser-split" rel="nofollow">Fix JavaScript Split</a>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

