<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://regexadvice.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>Tony's Regex Blog</title><link>http://regexadvice.com/blogs/tonys/default.aspx</link><description>author of Regular Expression Pocket Reference</description><dc:language>en</dc:language><generator>CommunityServer 2.1 (Build: 60809.935)</generator><item><title>Regular Expression Super Hero</title><link>http://regexadvice.com/blogs/tonys/archive/2007/01/17/Regular-Expression-Super-Hero.aspx</link><pubDate>Wed, 17 Jan 2007 00:01:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:26371</guid><dc:creator>tonys</dc:creator><slash:comments>1</slash:comments><comments>http://regexadvice.com/blogs/tonys/comments/26371.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/tonys/commentrss.aspx?PostID=26371</wfw:commentRss><description>&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;</description><category domain="http://regexadvice.com/blogs/tonys/archive/tags/xkcd+regex+comic+funny/default.aspx">xkcd regex comic funny</category></item><item><title>PDF of Regular Expression Pocket Reference</title><link>http://regexadvice.com/blogs/tonys/archive/2007/01/16/PDF-of-Regular-Expression-Pocket-Reference.aspx</link><pubDate>Tue, 16 Jan 2007 03:33:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:26301</guid><dc:creator>tonys</dc:creator><slash:comments>4</slash:comments><comments>http://regexadvice.com/blogs/tonys/comments/26301.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/tonys/commentrss.aspx?PostID=26301</wfw:commentRss><description>&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;</description></item><item><title>Write Your Own Regex Engine</title><link>http://regexadvice.com/blogs/tonys/archive/2005/05/18/935.aspx</link><pubDate>Wed, 18 May 2005 13:10:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:935</guid><dc:creator>tonys</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/blogs/tonys/comments/935.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/tonys/commentrss.aspx?PostID=935</wfw:commentRss><description>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;</description></item><item><title>Where's the whitespace?</title><link>http://regexadvice.com/blogs/tonys/archive/2004/03/12/299.aspx</link><pubDate>Sat, 13 Mar 2004 01:03:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:299</guid><dc:creator>tonys</dc:creator><slash:comments>2</slash:comments><comments>http://regexadvice.com/blogs/tonys/comments/299.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/tonys/commentrss.aspx?PostID=299</wfw:commentRss><description>&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;</description></item></channel></rss>