<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Regular Expression Exercise S1</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx</link><description>The first in a series of exercises designed to teach you more about regular expressions, written by a guy who got partway through writing a regex book. But first, a word about tools. It's a lot easier to use a tool to do this sort of thing than it is</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Regular Expression Exercise S1</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#483577</link><pubDate>Fri, 21 Oct 2005 23:23:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:483577</guid><dc:creator>Nat Luengnaruemitchai</dc:creator><description>^\d{3}-\d{2}-\d{4}$</description></item><item><title>re: Regular Expression Exercise S1</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#483700</link><pubDate>Sat, 22 Oct 2005 06:20:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:483700</guid><dc:creator>Dvae</dc:creator><description>Surely you'd want the hypens to be optional or replaceable by spaces.  Forcing a particlular format when enter a number like this, or a credit-card number can be a pain, unless you explictly tell the user in advance the format you want (as you have done).&lt;br&gt;&lt;br&gt;In any case, I'd use&lt;br&gt;^\d{3}[-| ]?\d{2}[-| ]?\d{4}$</description></item><item><title>re: Regular Expression Exercise S1</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#484093</link><pubDate>Mon, 24 Oct 2005 13:41:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:484093</guid><dc:creator>David</dc:creator><description>The best tool one can have when working with regular expressions is Regex Coach. &lt;a rel="nofollow" target="_new" href="http://weitz.de/regex-coach/"&gt;http://weitz.de/regex-coach/&lt;/a&gt;</description></item><item><title>re: Regular Expression Exercise S1</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#484148</link><pubDate>Mon, 24 Oct 2005 18:01:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:484148</guid><dc:creator>James Curran</dc:creator><description>Dvae:&lt;br&gt; Yes, but you'd want consistency in the separator use, so that it would accept &amp;quot;123-12-1234&amp;quot;, &amp;quot;123 12 1234&amp;quot; or &amp;quot;123121234&amp;quot; but not &amp;quot;12312 1234&amp;quot; or &amp;quot;123-12 1234&amp;quot;.  Hence we'd need:&lt;br&gt;&lt;br&gt;^\d{3}(?&amp;lt;Sep&amp;gt;[- ]?)\d{2}\&amp;lt;Sep&amp;gt;\d{4}$&lt;br&gt;&lt;br&gt;&lt;br&gt;(as interpreted by Regex Workbench)&lt;br&gt;&lt;br&gt;^ (anchor to start of string)&lt;br&gt;Any digit &lt;br&gt;Exactly 3 times&lt;br&gt;Capture to &amp;lt;Sep&amp;gt;&lt;br&gt;  Any character in &amp;quot;- &amp;quot;&lt;br&gt;  ? (zero or one time)&lt;br&gt;End Capture&lt;br&gt;Any digit &lt;br&gt;Exactly 2 times&lt;br&gt;&amp;lt;Sep&amp;gt;&lt;br&gt;Any digit &lt;br&gt;Exactly 4 times&lt;br&gt;$ (anchor to end of string)&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Regular Expression Exercise S1</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#484284</link><pubDate>Mon, 24 Oct 2005 22:53:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:484284</guid><dc:creator>Dave</dc:creator><description>&amp;gt; Yes, but you'd want consistency in the separator use&lt;br&gt;&lt;br&gt;True, but if we wanted consistency, then we'd force them to use the properly structured format, and not allow for any variance ;-)&lt;br&gt;&lt;br&gt;&amp;lt;strike&amp;gt;Dvae&amp;lt;/strike&amp;gt; Dave</description></item><item><title>re: Regular Expression Exercise S1</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#486037</link><pubDate>Fri, 28 Oct 2005 08:22:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:486037</guid><dc:creator>Richard</dc:creator><description>Why would I want to match one of those? Completely useless outside the US.</description></item><item><title>re: Regular Expression Exercise S1</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#486307</link><pubDate>Fri, 28 Oct 2005 20:34:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:486307</guid><dc:creator>James Curran</dc:creator><description>Um... So, RIchard, what exactly is the format of a Social Security Number outside the US?</description></item><item><title>re: Regular Expression Exercise S1</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#489585</link><pubDate>Sun, 06 Nov 2005 21:33:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:489585</guid><dc:creator>Rob</dc:creator><description>In the UK it is&lt;br&gt;&lt;br&gt;AA 00 00 00 A&lt;br&gt;&lt;br&gt;or&lt;br&gt;&lt;br&gt;^\w{2} \d{2} \d{2} \d{2} \w$</description></item><item><title> Eric Gunnerson s C Compendium Regular Expression Exercise S1 | Wood TV Stand</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#9672606</link><pubDate>Mon, 01 Jun 2009 02:21:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9672606</guid><dc:creator> Eric Gunnerson s C Compendium Regular Expression Exercise S1 | Wood TV Stand</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://woodtvstand.info/story.php?id=2664"&gt;http://woodtvstand.info/story.php?id=2664&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Eric Gunnerson s C Compendium Regular Expression Exercise S1 | Green Tea Fat Burner</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#9706931</link><pubDate>Mon, 08 Jun 2009 05:38:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9706931</guid><dc:creator> Eric Gunnerson s C Compendium Regular Expression Exercise S1 | Green Tea Fat Burner</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://greenteafatburner.info/story.php?id=2272"&gt;http://greenteafatburner.info/story.php?id=2272&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Eric Gunnerson s C Compendium Regular Expression Exercise S1 | pool toys</title><link>http://blogs.msdn.com/ericgu/archive/2005/10/21/483571.aspx#9774612</link><pubDate>Thu, 18 Jun 2009 11:54:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9774612</guid><dc:creator> Eric Gunnerson s C Compendium Regular Expression Exercise S1 | pool toys</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://pooltoysite.info/story.php?id=3255"&gt;http://pooltoysite.info/story.php?id=3255&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>