<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Regular Expressions, Part 2</title>
	<atom:link href="http://programmingpraxis.com/2009/09/18/regular-expressions-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmingpraxis.com/2009/09/18/regular-expressions-part-2/</link>
	<description>A collection of etudes, updated weekly, for the education and enjoyment of the savvy programmer</description>
	<lastBuildDate>Mon, 28 May 2012 03:30:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: programmingpraxis</title>
		<link>http://programmingpraxis.com/2009/09/18/regular-expressions-part-2/#comment-639</link>
		<dc:creator><![CDATA[programmingpraxis]]></dc:creator>
		<pubDate>Sun, 20 Sep 2009 12:14:58 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1328#comment-639</guid>
		<description><![CDATA[Sheri, from the WordPress Support Department, reports that the bug in the &#039;sourcecode&#039; feature has now been fixed.  I reported the bug on Friday evening and it was fixed by Sunday morning.  Well done, WordPress!

Phil]]></description>
		<content:encoded><![CDATA[<p>Sheri, from the WordPress Support Department, reports that the bug in the &#8216;sourcecode&#8217; feature has now been fixed.  I reported the bug on Friday evening and it was fixed by Sunday morning.  Well done, WordPress!</p>
<p>Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: programmingpraxis</title>
		<link>http://programmingpraxis.com/2009/09/18/regular-expressions-part-2/#comment-638</link>
		<dc:creator><![CDATA[programmingpraxis]]></dc:creator>
		<pubDate>Sat, 19 Sep 2009 02:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1328#comment-638</guid>
		<description><![CDATA[Remco:  I fixed the &#039;sourcecode&#039; tags on the HOWTOpage.  And I sent a bug report to the WordPress support center.  Thanks for pointing out the problems.]]></description>
		<content:encoded><![CDATA[<p>Remco:  I fixed the &#8216;sourcecode&#8217; tags on the HOWTOpage.  And I sent a bug report to the WordPress support center.  Thanks for pointing out the problems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: programmingpraxis</title>
		<link>http://programmingpraxis.com/2009/09/18/regular-expressions-part-2/#comment-637</link>
		<dc:creator><![CDATA[programmingpraxis]]></dc:creator>
		<pubDate>Sat, 19 Sep 2009 01:18:29 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1328#comment-637</guid>
		<description><![CDATA[kbob:  This blog is getting programmers to write code, so that they can maintain and improve their coding skills.  This blog is not about computer science or the comparative study of algorithms.  It really doesn&#039;t matter to me that I have the fastest algorithm that solves the particular programming problem I am discussing.  I do have a two-part series regex-&gt;nfa, nfa-&gt;dfa on my idea list, but that doesn&#039;t mean I&#039;ll ever write it.]]></description>
		<content:encoded><![CDATA[<p>kbob:  This blog is getting programmers to write code, so that they can maintain and improve their coding skills.  This blog is not about computer science or the comparative study of algorithms.  It really doesn&#8217;t matter to me that I have the fastest algorithm that solves the particular programming problem I am discussing.  I do have a two-part series regex-&gt;nfa, nfa-&gt;dfa on my idea list, but that doesn&#8217;t mean I&#8217;ll ever write it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Posts about Programming from google blogs as of September 18, 2009 &#171; tryfly.com</title>
		<link>http://programmingpraxis.com/2009/09/18/regular-expressions-part-2/#comment-636</link>
		<dc:creator><![CDATA[Posts about Programming from google blogs as of September 18, 2009 &#171; tryfly.com]]></dc:creator>
		<pubDate>Fri, 18 Sep 2009 23:47:56 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1328#comment-636</guid>
		<description><![CDATA[[...]  [...]]]></description>
		<content:encoded><![CDATA[<p>[...]  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remco Niemeijer</title>
		<link>http://programmingpraxis.com/2009/09/18/regular-expressions-part-2/#comment-635</link>
		<dc:creator><![CDATA[Remco Niemeijer]]></dc:creator>
		<pubDate>Fri, 18 Sep 2009 20:37:16 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1328#comment-635</guid>
		<description><![CDATA[On a side note, the &#039;HOWTO: Posting source code&#039; page no longer shows the actual tags required. You might want to fix that.

Also, the source code plugin now seems to htmlEncode characters like &amp; and &gt;, which screws up function types and such.]]></description>
		<content:encoded><![CDATA[<p>On a side note, the &#8216;HOWTO: Posting source code&#8217; page no longer shows the actual tags required. You might want to fix that.</p>
<p>Also, the source code plugin now seems to htmlEncode characters like &amp; and &gt;, which screws up function types and such.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remco Niemeijer</title>
		<link>http://programmingpraxis.com/2009/09/18/regular-expressions-part-2/#comment-634</link>
		<dc:creator><![CDATA[Remco Niemeijer]]></dc:creator>
		<pubDate>Fri, 18 Sep 2009 20:32:22 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1328#comment-634</guid>
		<description><![CDATA[My Haskell solution (see http://bonsaicode.wordpress.com/2009/09/18/programming-praxis-regular-expressions-part-2/ for a version with comments):

[sourcecode language=&quot;css&quot;]
import Data.List

data Elem = Lit Char &#124; Esc Char &#124; Any &#124; Set Bool [Elem] deriving Show
data Chunk = Elem Elem &#124; BoL &#124; EoL &#124; Star Elem deriving Show

matchElem :: Elem -&gt; Char -&gt; Bool
matchElem e c = case e of Lit l    -&gt; l == c
                          Esc s    -&gt; show c == &#039;\\&#039;:[s]
                          Set b es -&gt; b == any (`matchElem` c) es
                          Any      -&gt; True

matchHere :: [Chunk] -&gt; String -&gt; Bool
matchHere (Elem r:rs) (x:xs) = matchElem r x &amp;&amp; matchHere rs xs
matchHere (Star e:r)  xs     = matchStar e r xs
matchHere [EoL]       xs     = null xs
matchHere r           _      = null r

matchStar :: Elem -&gt; [Chunk] -&gt; String -&gt; Bool
matchStar _ r xs     &#124; matchHere r xs = True
matchStar e r (x:xs) = matchElem e x &amp;&amp; matchStar e r xs
matchStar _ _ _      = False

match :: [Chunk] -&gt; String -&gt; Bool
match (BoL:r) = matchHere r
match r       = any (matchHere r) . tails
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>My Haskell solution (see <a href="http://bonsaicode.wordpress.com/2009/09/18/programming-praxis-regular-expressions-part-2/" rel="nofollow">http://bonsaicode.wordpress.com/2009/09/18/programming-praxis-regular-expressions-part-2/</a> for a version with comments):</p>
<pre class="brush: css;">
import Data.List

data Elem = Lit Char | Esc Char | Any | Set Bool [Elem] deriving Show
data Chunk = Elem Elem | BoL | EoL | Star Elem deriving Show

matchElem :: Elem -&gt; Char -&gt; Bool
matchElem e c = case e of Lit l    -&gt; l == c
                          Esc s    -&gt; show c == '\\':[s]
                          Set b es -&gt; b == any (`matchElem` c) es
                          Any      -&gt; True

matchHere :: [Chunk] -&gt; String -&gt; Bool
matchHere (Elem r:rs) (x:xs) = matchElem r x &amp;&amp; matchHere rs xs
matchHere (Star e:r)  xs     = matchStar e r xs
matchHere [EoL]       xs     = null xs
matchHere r           _      = null r

matchStar :: Elem -&gt; [Chunk] -&gt; String -&gt; Bool
matchStar _ r xs     | matchHere r xs = True
matchStar e r (x:xs) = matchElem e x &amp;&amp; matchStar e r xs
matchStar _ _ _      = False

match :: [Chunk] -&gt; String -&gt; Bool
match (BoL:r) = matchHere r
match r       = any (matchHere r) . tails
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: kbob</title>
		<link>http://programmingpraxis.com/2009/09/18/regular-expressions-part-2/#comment-633</link>
		<dc:creator><![CDATA[kbob]]></dc:creator>
		<pubDate>Fri, 18 Sep 2009 14:17:22 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1328#comment-633</guid>
		<description><![CDATA[I hope you&#039;re planning on moving on to NFA-based regular expression matching, because the naive, exponential-time regex engine this series is developing is severely suboptimal.  Automata, NFA and DFA, are beautiful, useful, and not difficult.]]></description>
		<content:encoded><![CDATA[<p>I hope you&#8217;re planning on moving on to NFA-based regular expression matching, because the naive, exponential-time regex engine this series is developing is severely suboptimal.  Automata, NFA and DFA, are beautiful, useful, and not difficult.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

