<?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: Sprinkling an &#8216;or&#8217; on your regex</title>
	<atom:link href="http://blog.jeffreyforman.net/2010/03/26/sprinkling-an-or-on-your-regex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jeffreyforman.net/2010/03/26/sprinkling-an-or-on-your-regex/</link>
	<description>That&#039;s my story, and I&#039;m sticking to it.</description>
	<lastBuildDate>Thu, 27 Jan 2011 23:03:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Steve Laniel</title>
		<link>http://blog.jeffreyforman.net/2010/03/26/sprinkling-an-or-on-your-regex/comment-page-1/#comment-165</link>
		<dc:creator>Steve Laniel</dc:creator>
		<pubDate>Sat, 27 Mar 2010 14:42:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffreyforman.net/2010/03/26/sprinkling-an-or-on-your-regex/#comment-165</guid>
		<description>A few things:

1) That&#039;s not just Python. That&#039;s essentially all regular expressions. It&#039;s called &quot;alternation,&quot; if you&#039;re curious. Look in the man page for grep(1).
2) The shorter and better way to say [0-9] is &quot;\d&quot;. So your regex could be shortened to
&quot;\d{6}&#124;\d{7}&quot;.
3) The &quot;character classes&quot; (things like &quot;[0-9]&quot; or &quot;[A-Za-z]&quot;) are actually just more-concise ways of expressing alternation. So, for instance, &quot;[0-9]&quot; is identical to &quot;0&#124;1&#124;2&#124;3&#124;...&#124;8&#124;9&quot;.
4) You may already know that if you were looking for 6, 7, or 8 digits, you could use &quot;\d{6,8}&quot;.</description>
		<content:encoded><![CDATA[<p>A few things:</p>
<p>1) That&#8217;s not just Python. That&#8217;s essentially all regular expressions. It&#8217;s called &#8220;alternation,&#8221; if you&#8217;re curious. Look in the man page for grep(1).<br />
2) The shorter and better way to say [0-9] is &#8220;\d&#8221;. So your regex could be shortened to<br />
&#8220;\d{6}|\d{7}&#8221;.<br />
3) The &#8220;character classes&#8221; (things like &#8220;[0-9]&#8221; or &#8220;[A-Za-z]&#8220;) are actually just more-concise ways of expressing alternation. So, for instance, &#8220;[0-9]&#8221; is identical to &#8220;0|1|2|3|&#8230;|8|9&#8243;.<br />
4) You may already know that if you were looking for 6, 7, or 8 digits, you could use &#8220;\d{6,8}&#8221;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

