<?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: Via Twitter, an interesting regexp_replace puzzle</title>
	<atom:link href="http://only4left.jpiwowar.com/2009/04/regexp_replace_puzzle/feed/" rel="self" type="application/rss+xml" />
	<link>http://only4left.jpiwowar.com/2009/04/regexp_replace_puzzle/</link>
	<description>Oracle stuff.  Some Linux and Mac stuff.  ALTER TABLE blog DISABLE UNIQUE (content_type);</description>
	<lastBuildDate>Thu, 19 Jan 2012 20:13:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
	<item>
		<title>By: jpiwowar</title>
		<link>http://only4left.jpiwowar.com/2009/04/regexp_replace_puzzle/comment-page-1/#comment-789</link>
		<dc:creator>jpiwowar</dc:creator>
		<pubDate>Tue, 07 Apr 2009 12:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://only4left.jpiwowar.com/2009/04/regexp_replace_puzzle/#comment-789</guid>
		<description>Hello Laurent,

Re #1: Fewer characters == better.  Your solution is much more tidy, thank you!  

Re #2: Argh, you are absolutely correct about the bug...I was far too quick when reviewing that code. :-(  Thank you for your replace() solution, too.  It&#039;s a good illustration that even if it looks like a regex problem, it may not be.

Thank you very much for the beneficial corrections, and for the visit! 

Regards,

John P.

&lt;del&gt;Note to readers: The backslashes in Laurent&#039;s solution printed correctly, but my blog has a bad habit of inserting &quot;smart&quot; quotes instead of normal quotes, even in &lt;pre&gt; and &lt;code&gt; blocks.  Please copy and paste with care, until I can correct my Wordpress setup. :)&lt;/del&gt;  Fixed, I think!</description>
		<content:encoded><![CDATA[<p>Hello Laurent,</p>
<p>Re #1: Fewer characters == better.  Your solution is much more tidy, thank you!  </p>
<p>Re #2: Argh, you are absolutely correct about the bug...I was far too quick when reviewing that code. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />   Thank you for your replace() solution, too.  It's a good illustration that even if it looks like a regex problem, it may not be.</p>
<p>Thank you very much for the beneficial corrections, and for the visit! </p>
<p>Regards,</p>
<p>John P.</p>
<p><del>Note to readers: The backslashes in Laurent's solution printed correctly, but my blog has a bad habit of inserting "smart" quotes instead of normal quotes, even in &lt;pre&gt; and &lt;code&gt; blocks.  Please copy and paste with care, until I can correct my WordPress setup. <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </del>  Fixed, I think!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurent Schneider</title>
		<link>http://only4left.jpiwowar.com/2009/04/regexp_replace_puzzle/comment-page-1/#comment-786</link>
		<dc:creator>Laurent Schneider</dc:creator>
		<pubDate>Tue, 07 Apr 2009 07:41:46 +0000</pubDate>
		<guid isPermaLink="false">http://only4left.jpiwowar.com/2009/04/regexp_replace_puzzle/#comment-786</guid>
		<description>for the first solution, you can make it 5 char shorter ;)
&lt;code&gt;
regexp_replace(&#039;&quot;a&quot;bcd\&quot;efg&quot;hi&quot;&#039;,&#039;(^&#124;[^\])&quot;+&#039;,&#039;\1&#124;&#039;)
&lt;/code&gt;
for the second solution, it is not only buggy, (there are four double-quotes between efg and hi), but it is also way to long and way to slow !
&lt;code&gt;
replace(replace(replace(&#039;&quot;&quot;&quot;a&quot;bcd\&quot;efg&quot;&quot;&quot;&quot;hi&quot;&quot;&quot;&quot;&#039;,&#039;\&quot;&#039;,&#039;ÿ&#039;),&#039;&quot;&#039;,&#039;&#124;&#039;),&#039;ÿ&#039;,&#039;\&quot;&#039;)
&lt;/code&gt;

(I hope the backslash will print correctly, I have lots of issues with backslash on my blog...)

Thanks for the challenge!</description>
		<content:encoded><![CDATA[<p>for the first solution, you can make it 5 char shorter <img src='http://only4left.jpiwowar.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<code><br />
regexp_replace('"a"bcd\"efg"hi"','(^|[^\])"+','\1|')<br />
</code><br />
for the second solution, it is not only buggy, (there are four double-quotes between efg and hi), but it is also way to long and way to slow !<br />
<code><br />
replace(replace(replace('"""a"bcd\"efg""""hi""""','\"','ÿ'),'"','|'),'ÿ','\"')<br />
</code></p>
<p>(I hope the backslash will print correctly, I have lots of issues with backslash on my blog...)</p>
<p>Thanks for the challenge!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

