<?xml version="1.0" encoding="windows-1252"?>
<node id="86328" title="Re: Re: Golf challange: match U.S. State names" created="2001-06-06 18:13:37" updated="2005-07-19 14:08:39">
<type id="11">
note</type>
<author id="22308">
dws</author>
<data>
<field name="doctext">
Now 108
&lt;code&gt;/^\w\w\z/&amp;("MNCAKSCOHINMOKTNVALARIDCTX SDE GAZ ORIL IAKY"=~/$_/|
/(FL|M[ADEIST]|N[DEHNJY]|PA|[UV]T|W[AIVY])/)
&lt;/code&gt;
Another stoke off by adding a redundant check for Alaska, which allowed me to move Iowa and Kentucky out of the regexp and into the (more compact) string.
&lt;p&gt;
This suggests that there's a lesson in here about how a bit of redundancy in data can lead to more compact representations. I think we often hear problems like "match every state and nothing else" as "match every state &lt;i&gt;exactly once,&lt;/i&gt; and nothing else."
&lt;p&gt;

</field>
<field name="root_node">
86047</field>
<field name="parent_node">
86132</field>
</data>
</node>
