<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Problem with regex order</title>
	<link>http://ask.metafilter.com/94441/Problem-with-regex-order/</link>
	<description>Comments on Ask MetaFilter post Problem with regex order</description>
	<pubDate>Wed, 18 Jun 2008 16:08:19 -0800</pubDate>
	<lastBuildDate>Wed, 18 Jun 2008 16:08:19 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Problem with regex order</title>
		<link>http://ask.metafilter.com/94441/Problem-with-regex-order</link>	
		<description>RegExFilter: Can any regular expression ninjas help me with my this teensy problem? &lt;br /&gt;&lt;br /&gt; I&apos;m validating an input in cakephp as follow:&lt;br&gt;
&lt;br&gt;
&apos;rule&apos; =&amp;gt; array(&apos;custom&apos;, &apos;/^[a-zA-Z\&apos;&amp;amp;.\s]{1,40}$/&apos;)&lt;br&gt;
&lt;br&gt;
It works great in that it allows letters, spaces, ampersand, apostrophe, period and numbers.&lt;br&gt;
&lt;br&gt;
For example: &lt;strong&gt;Jim&apos;s Number 1 Tackle &amp;amp; Rod Shop.&lt;/strong&gt; validates.&lt;br&gt;
&lt;br&gt;
The problem arises when there is a number first, for example &lt;strong&gt;2you delivery services&lt;/strong&gt; will not validate.&lt;br&gt;
&lt;br&gt;
I know it has something to do with the order in which the expression is written, but I can&apos;t figure it out. Anyone know what I&apos;m doing wrong?&lt;br&gt;
&lt;br&gt;
Thanks, as always.</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2008:site.94441</guid>
		<pubDate>Wed, 18 Jun 2008 16:03:11 -0800</pubDate>
		<dc:creator>ReiToei</dc:creator>
		
			<category>regex</category>
		
			<category>programming</category>
		
			<category>php</category>
		
	</item> <item>
		<title>By: ReiToei</title>
		<link>http://ask.metafilter.com/94441/Problem-with-regex-order#1380101</link>	
		<description>Sorry, Jim&apos;s Number 1 Tackle &amp;amp; Rod Shop doesn&apos;t validate. I WANT it to validate!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.94441-1380101</guid>
		<pubDate>Wed, 18 Jun 2008 16:08:19 -0800</pubDate>
		<dc:creator>ReiToei</dc:creator>
	</item><item>
		<title>By: ReiToei</title>
		<link>http://ask.metafilter.com/94441/Problem-with-regex-order#1380110</link>	
		<description>Uh, figured out... I&apos;m sooo dumb. Can an admin delete this please? Thanks :)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.94441-1380110</guid>
		<pubDate>Wed, 18 Jun 2008 16:13:48 -0800</pubDate>
		<dc:creator>ReiToei</dc:creator>
	</item><item>
		<title>By: Mike1024</title>
		<link>http://ask.metafilter.com/94441/Problem-with-regex-order#1380119</link>	
		<description>Missing a \d, eh? Easy to do...&lt;br&gt;
&lt;br&gt;
You&apos;ve validated that the rule excludes everything you want to exclude, right? because in some regexp formats . means &apos;any character&apos; so your regexp would match everything.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.94441-1380119</guid>
		<pubDate>Wed, 18 Jun 2008 16:20:34 -0800</pubDate>
		<dc:creator>Mike1024</dc:creator>
	</item><item>
		<title>By: Deathalicious</title>
		<link>http://ask.metafilter.com/94441/Problem-with-regex-order#1380150</link>	
		<description>Unless you don&apos;t want underscores, this shorter regex could do the trick:&lt;pre&gt;^[\w\&apos;&amp;amp;\. ]{1,40}&lt;br&gt;         ^&lt;/pre&gt;I&apos;d use a simple space rather than \s. You probably don&apos;t want to allow tabs or returns.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.94441-1380150</guid>
		<pubDate>Wed, 18 Jun 2008 16:48:39 -0800</pubDate>
		<dc:creator>Deathalicious</dc:creator>
	</item><item>
		<title>By: trouserbat</title>
		<link>http://ask.metafilter.com/94441/Problem-with-regex-order#1380201</link>	
		<description>Sounds like you already have your answer, but for the archives -- if you use Emacs, the &lt;strong&gt;M-x re-builder&lt;/strong&gt; tool is great for this stuff.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.94441-1380201</guid>
		<pubDate>Wed, 18 Jun 2008 18:15:53 -0800</pubDate>
		<dc:creator>trouserbat</dc:creator>
	</item><item>
		<title>By: ReiToei</title>
		<link>http://ask.metafilter.com/94441/Problem-with-regex-order#1380526</link>	
		<description>Thanks for all the help guys! Will definitely check out that tool for Emacs.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.94441-1380526</guid>
		<pubDate>Thu, 19 Jun 2008 03:37:47 -0800</pubDate>
		<dc:creator>ReiToei</dc:creator>
	</item>
	</channel>
</rss>
