<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://regexadvice.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Tony's Regex Blog</title><subtitle type="html">author of Regular Expression Pocket Reference</subtitle><id>http://regexadvice.com/blogs/tonys/atom.aspx</id><link rel="alternate" type="text/html" href="http://regexadvice.com/blogs/tonys/default.aspx" /><link rel="self" type="application/atom+xml" href="http://regexadvice.com/blogs/tonys/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.60809.935">Community Server</generator><updated>2004-03-12T20:03:00Z</updated><entry><title>Regular Expression Super Hero</title><link rel="alternate" type="text/html" href="http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx" /><id>http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx</id><published>2007-01-17T00:01:00Z</published><updated>2007-01-17T00:01:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://www.xkcd.com/c208.html"&gt;&lt;img src="http://imgs.xkcd.com/comics/regular_expressions.png" height="607" width="600" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.xkcd.com/c208.html"&gt;http://www.xkcd.com/c208.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;xkcd has many great comics, although this is the only regex one that I know of.&lt;br /&gt;&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx&amp;amp;;subject=Regular+Expression+Super+Hero" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx&amp;amp;;title=Regular+Expression+Super+Hero" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx&amp;amp;title=Regular+Expression+Super+Hero" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx&amp;amp;;title=Regular+Expression+Super+Hero" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx&amp;amp;;title=Regular+Expression+Super+Hero&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=26371" width="1" height="1"&gt;</content><author><name>tonys</name><uri>http://regexadvice.com/members/tonys.aspx</uri></author><category term="xkcd regex comic funny" scheme="http://regexadvice.com/blogs/tonys/archive/tags/xkcd+regex+comic+funny/default.aspx" /></entry><entry><title>PDF of Regular Expression Pocket Reference</title><link rel="alternate" type="text/html" href="http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx" /><id>http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx</id><published>2007-01-16T03:33:00Z</published><updated>2007-01-16T03:33:00Z</updated><content type="html">&lt;p&gt;O&amp;#39;Reilly decided to release all of their &lt;a href="http://www.oreilly.com/store/series/pocketrefs.csp"&gt;pocket references&lt;/a&gt; as PDFs. You can get a copy of the &lt;a href="http://www.oreilly.com/catalog/regexppr/"&gt;Regex Pocket Reference&lt;/a&gt; for $4.99.&lt;/p&gt;&lt;p&gt;I&amp;#39;ve really liked the trend of releasing books in PDF, especially references, because it means I can travel with my reference library on my laptop.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx&amp;amp;;subject=PDF+of+Regular+Expression+Pocket+Reference" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx&amp;amp;;title=PDF+of+Regular+Expression+Pocket+Reference" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx&amp;amp;title=PDF+of+Regular+Expression+Pocket+Reference" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx&amp;amp;;title=PDF+of+Regular+Expression+Pocket+Reference" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx&amp;amp;;title=PDF+of+Regular+Expression+Pocket+Reference&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=26301" width="1" height="1"&gt;</content><author><name>tonys</name><uri>http://regexadvice.com/members/tonys.aspx</uri></author></entry><entry><title>Write Your Own Regex Engine</title><link rel="alternate" type="text/html" href="http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx" /><id>http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx</id><published>2005-05-18T13:10:00Z</published><updated>2005-05-18T13:10:00Z</updated><content type="html">Just ran across a Mark-Jason Dominus &lt;a href="http://perl.plover.com/Regex/article.html"&gt;article&lt;/a&gt;
on writing your own regex engine. Reading the article and just
contemplating writing the code is enough to give you insight into how
regex engines work. And the more you know about regex engines the less
often you'll be surprised by their behavior =)&lt;br&gt;
&lt;br&gt;
For non-Perl users, it's worth checking out the Perl community's regex
knowledge base. They've got a long history of regex use and struggle
(and everyone seems to have copied their regex implementation).
Mark-Jason's writings are one good place to start. His &lt;a href="http://perl.plover.com/yak/regex/"&gt;regex talk&lt;/a&gt; is one
of the best. The talk's not free, but he's been nice enough to put the
&lt;a href="http://perl.plover.com/yak/regex/samples/slide001.html"&gt;slides&lt;/a&gt; up.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx&amp;amp;;subject=Write+Your+Own+Regex+Engine" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx&amp;amp;;title=Write+Your+Own+Regex+Engine" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx&amp;amp;title=Write+Your+Own+Regex+Engine" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx&amp;amp;;title=Write+Your+Own+Regex+Engine" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx&amp;amp;;title=Write+Your+Own+Regex+Engine&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=935" width="1" height="1"&gt;</content><author><name>tonys</name><uri>http://regexadvice.com/members/tonys.aspx</uri></author></entry><entry><title>Where's the whitespace?</title><link rel="alternate" type="text/html" href="http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx" /><id>http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx</id><published>2004-03-13T01:03:00Z</published><updated>2004-03-13T01:03:00Z</updated><content type="html">&lt;p&gt;I'm really sad that Perl didn't solve the issue of regex readability before regex popularity exploded across every other programming language. Unreadable regular expressions have become a cross-cultural norm. Unfortunately Perl 6, which will have the extended whitespace feature enabled by default, will be released two years too late.&lt;/p&gt;

&lt;p&gt;Fortunately for the brave few willing to break with tradition, you can easily add white space to your regular expressions. Every programmer alive already adds whitespace to every other programming language. I doubt anyone finds the regular expression syntax so verbose and readable that whitespace has become obsolete.&lt;/p&gt;

&lt;p&gt;Here's how you add whitespace to various languages:

&lt;li&gt;Perl: &lt;code&gt;m/pattern/x&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;java.util.regex: &lt;code&gt;Pattern.COMMENTS&lt;/code&gt; or the &lt;code&gt;x&lt;/code&gt; modifier&lt;/li&gt;
&lt;li&gt;.NET: &lt;code&gt;IgnorePatternWhitespace&lt;/code&gt; or the &lt;code&gt;x&lt;/code&gt; modifier&lt;/li&gt;
&lt;li&gt;Python: &lt;code&gt;X&lt;/code&gt; or &lt;code&gt;VERBOSE&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;PHP: &lt;code&gt;/pattern/x&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Javascript: Doesn't support it but who cares. You can get around it with this:&lt;/li&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;
var phone regex = 
       "\\d\\d\\d"    // area code
    + "\\d\\d\\d-"    // prefix
    + "\\d\\d\\d";    // exchange
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;I've got more to say about the importance of whitespace in my article, &lt;a href="http://www.onlamp.com/pub/a/onlamp/2003/08/21/regexp.html"&gt;Five Habits for Successful Regular Expressions&lt;/a&gt; and in some slides from my talk &lt;a href="http://tonys.oreillynet.com/talks/bestpractice/"&gt;Regular Expression Best Practices&lt;/a&gt;.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx&amp;amp;;subject=Where%27s+the+whitespace%3f" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx&amp;amp;;title=Where%27s+the+whitespace%3f" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx&amp;amp;title=Where%27s+the+whitespace%3f" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx&amp;amp;;title=Where%27s+the+whitespace%3f" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx&amp;amp;;title=Where%27s+the+whitespace%3f&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=299" width="1" height="1"&gt;</content><author><name>tonys</name><uri>http://regexadvice.com/members/tonys.aspx</uri></author></entry></feed>