<?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>RegEx ReMarks</title><link>http://regexadvice.com/blogs/ssmith/default.aspx</link><description>Some opinions, advice, and rants about regular expressions.</description><dc:language>en</dc:language><generator>CommunityServer 2.1 (Build: 60809.935)</generator><item><title>April RegexLib Update</title><link>http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx</link><pubDate>Wed, 19 Apr 2006 15:25:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:16608</guid><dc:creator>ssmith</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/blogs/ssmith/comments/16608.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/ssmith/commentrss.aspx?PostID=16608</wfw:commentRss><description>&lt;P&gt;I've made some more improvements to the &lt;A href="http://regexlib.com/"&gt;Regular Expression Library &lt;/A&gt;today.&amp;nbsp; Here's a summary:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Added a new &lt;A href="http://regexlib.com/Contributors.aspx"&gt;Contributors &lt;/A&gt;page to make it easier to find expressions by user.&lt;/LI&gt;
&lt;LI&gt;Improved the Navigation and look and feel of the top menu&lt;/LI&gt;
&lt;LI&gt;Added links to blogs and forums to main nav&lt;/LI&gt;
&lt;LI&gt;Added links to contributors page to side nav&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Not a huge update, but I've had a few users contact me asking how they can find their expressions, so now it should be pretty simple to do so from the Contributors page.&amp;nbsp; You should also be able to log in and view My Regular Expressions.&amp;nbsp; If that doesn't work, please let me know ("It works for me").&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/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx&amp;amp;;subject=April+RegexLib+Update" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx&amp;amp;;title=April+RegexLib+Update" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx&amp;amp;title=April+RegexLib+Update" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx&amp;amp;;title=April+RegexLib+Update" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.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/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx&amp;amp;;title=April+RegexLib+Update&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/04/19/April-RegexLib-Update.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=16608" width="1" height="1"&gt;</description></item><item><title>Regular Expression Library Update</title><link>http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx</link><pubDate>Fri, 10 Feb 2006 15:57:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:15123</guid><dc:creator>ssmith</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/blogs/ssmith/comments/15123.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/ssmith/commentrss.aspx?PostID=15123</wfw:commentRss><description>&lt;P&gt;I updated &lt;A href="http://regexlib.com/"&gt;Regular Expression Library &lt;/A&gt;last night and sent out emails to about 700 people letting them know.&amp;nbsp; I apologize that at the moment I neglected to include a way to edit your profile or reset your password, so for now users are stuck with ugly random strings as passwords, but I should have that corrected in the next day or two, at which point I'll send out another email (the last I promise).&lt;/P&gt;
&lt;P&gt;The new site is running on&amp;nbsp;its own&amp;nbsp;separate database (it had been using the same one as&lt;A href="http://aspalliance.com/"&gt; ASPAlliance.com&lt;/A&gt;), has implemented some more efficient data access and cache techniques, and is now using ASP.NET 2.0 (which for now means little to users but will mean easier updates in the future).&amp;nbsp; Please let me know if you find anything wrong with the site (via the site's &lt;A href="http://regexlib.com/contact.aspx"&gt;Contact &lt;/A&gt;page).&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/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx&amp;amp;;subject=Regular+Expression+Library+Update" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx&amp;amp;;title=Regular+Expression+Library+Update" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx&amp;amp;title=Regular+Expression+Library+Update" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx&amp;amp;;title=Regular+Expression+Library+Update" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.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/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx&amp;amp;;title=Regular+Expression+Library+Update&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2006/02/10/Regular-Expression-Library-Update.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=15123" width="1" height="1"&gt;</description></item><item><title>Regex 101 Posts by Eric Gunnerson</title><link>http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx</link><pubDate>Tue, 15 Nov 2005 16:46:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:13811</guid><dc:creator>ssmith</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/blogs/ssmith/comments/13811.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/ssmith/commentrss.aspx?PostID=13811</wfw:commentRss><description>I just ran across &lt;A href="http://blogs.msdn.com/ericgu/archive/category/11323.aspx"&gt;Eric Gunnerson's Regex 101 category of posts&lt;/A&gt;, which is dedicated to helping folks learn about regular expressions through a series of articles (I actually ran across his posts via the &lt;A href="http://www.dotnetslackers.com/Regex/re-default.aspx"&gt;Regex Category of DotNetSlackers.com&lt;/A&gt;, a nice news site).&amp;nbsp; Anyway, check it out.&amp;nbsp; Many of the answers are in &lt;A href="http://regexlib.com"&gt;RegExLib.com&lt;/A&gt;, from what I saw (and if not, add them!).
&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/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx&amp;amp;;subject=Regex+101+Posts+by+Eric+Gunnerson" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx&amp;amp;;title=Regex+101+Posts+by+Eric+Gunnerson" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx&amp;amp;title=Regex+101+Posts+by+Eric+Gunnerson" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx&amp;amp;;title=Regex+101+Posts+by+Eric+Gunnerson" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.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/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx&amp;amp;;title=Regex+101+Posts+by+Eric+Gunnerson&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/11/15/Regex-101-Posts-by-Eric-Gunnerson.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=13811" width="1" height="1"&gt;</description></item><item><title>Moved to CS 1.0</title><link>http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.aspx</link><pubDate>Fri, 15 Apr 2005 06:06:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:772</guid><dc:creator>ssmith</dc:creator><slash:comments>1</slash:comments><comments>http://regexadvice.com/blogs/ssmith/comments/772.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/ssmith/commentrss.aspx?PostID=772</wfw:commentRss><description>Testing a new post now that the site has moved to Community Server 1.0.
&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/ssmith/archive/2005/04/15/772.aspx&amp;amp;;subject=Moved+to+CS+1.0" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.aspx&amp;amp;;title=Moved+to+CS+1.0" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.aspx&amp;amp;title=Moved+to+CS+1.0" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.aspx&amp;amp;;title=Moved+to+CS+1.0" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.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/ssmith/archive/2005/04/15/772.aspx&amp;amp;;title=Moved+to+CS+1.0&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/15/772.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=772" width="1" height="1"&gt;</description></item><item><title>You want to use a regex to do WHAT?</title><link>http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.aspx</link><pubDate>Fri, 01 Apr 2005 21:51:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:270</guid><dc:creator>ssmith</dc:creator><slash:comments>15</slash:comments><comments>http://regexadvice.com/blogs/ssmith/comments/270.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/ssmith/commentrss.aspx?PostID=270</wfw:commentRss><description>&lt;P&gt;This is in response to the comments and blog posts made on &lt;A HREF="/blogs/jschoolcraft/archive/2005/03/31/267.aspx"&gt;Jeffrey Schoolcraft's &lt;/A&gt;and &lt;A HREF="/blogs/dneimke/archive/2005/04/01/259.aspx"&gt;Darren Neimke's &lt;/A&gt;blogs.&lt;/P&gt;
&lt;P&gt;I have to disagree with the blanket statement that regular expressions should never, ever be used to try and match email, date, or HTML patterns.&amp;nbsp; I'm almost at a loss here to even get into it, because the first thing that comes to mind is to just say "Oh come on now, seriously!"&amp;nbsp; Granted the comment was left on April Fool's Day (although the server claims otherwise)... Anyway, in order to disprove the blanket statement, it is only necessary to come up with a single useful application for such expressions, preferably one for which a more code-intensive approach would not be well-suited.&lt;/P&gt;
&lt;P&gt;How about data entry?&amp;nbsp; I've written a few call center applications.&amp;nbsp; It's also common these days to use web-based data entry applications on intranets because of the easy updates web-based applications allow for.&amp;nbsp; With any data entry application, speed of entry is important, but so is accuracy.&amp;nbsp; The best time to correct something is as soon as it's been entered (through input masking or perhaps OnBlur).&amp;nbsp; To accomplish this in a web application typically means JavaScript.&amp;nbsp; JavaScript supports regular expressions quite well, but isn't really well-suited to communicating with mail servers.&lt;/P&gt;
&lt;P&gt;So, ideally, if you want the best user experience, you'll use a regular expression for the emails, dates, phone numbers, etc. in the application tied to javascript.&amp;nbsp; Then, when a record is submitted, you can perform better validation.&amp;nbsp; It might be sufficient just to check that the email was well-formed and the date properly formatted with the regex, while the application uses code to try to verify that the email is valid (or ideally, requires the user to confirm it by responding to an emailed inquiry).&amp;nbsp; The application would also be responsible for ensuring that dates, beyond being properly formatted, are valid for whatever purpose they're serving (date of birth probably should be in the past, for instance).&lt;/P&gt;
&lt;P&gt;Thus, regular expressions can provide 'good enough' validation to allow for most typographic errors to be caught and enhance the user experience by providing immediate feedback in scenarios where code-intensive validation is impractical.&amp;nbsp; Better validation should then be performed elsewhere, usually in some middle tier business rule enforcing area.&lt;/P&gt;
&lt;P&gt;This is the most obvious example, and one I've personally encountered many times as a consultant at different companies.&amp;nbsp; I'm sure there are other scenarios where the quickness and simplicity of a regex outweighs the value of the additional accuracy that a more code intensive approach might provide.&amp;nbsp; Again, it's a trade-off of what is 'good enough' and in many cases a regex will suffice even in situations where it doesn't catch every possible error.&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/ssmith/archive/2005/04/01/270.aspx&amp;amp;;subject=You+want+to+use+a+regex+to+do+WHAT%3f" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.aspx&amp;amp;;title=You+want+to+use+a+regex+to+do+WHAT%3f" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.aspx&amp;amp;title=You+want+to+use+a+regex+to+do+WHAT%3f" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.aspx&amp;amp;;title=You+want+to+use+a+regex+to+do+WHAT%3f" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.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/ssmith/archive/2005/04/01/270.aspx&amp;amp;;title=You+want+to+use+a+regex+to+do+WHAT%3f&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2005/04/01/270.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=270" width="1" height="1"&gt;</description></item><item><title>Regex Character Classes</title><link>http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.aspx</link><pubDate>Wed, 03 Mar 2004 18:12:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:269</guid><dc:creator>ssmith</dc:creator><slash:comments>2</slash:comments><comments>http://regexadvice.com/blogs/ssmith/comments/269.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/ssmith/commentrss.aspx?PostID=269</wfw:commentRss><description>&lt;P&gt;I'm writing an article on regular expressions for msdn online and I've just finished a section on character classes.&amp;nbsp; Character classes, of course, are those sections of regular expression patterns enclosed in hard braces &lt;STRONG&gt;[ ]&lt;/STRONG&gt;.&amp;nbsp; One point I'm trying to express in the article which I think is a point of confusion for many people when dealing with regular expressions is that the grammar for character classes is wholly different from that of the rest of regular expressions.&amp;nbsp; They are basically a separate language within the language, with their own special syntax rules and metacharacters.&amp;nbsp; For instance, while &lt;STRONG&gt;$&lt;/STRONG&gt;, &lt;STRONG&gt;.&lt;/STRONG&gt;, and &lt;STRONG&gt;\&lt;/STRONG&gt; are metacharacters anywhere else in a regular expression, they are simply literals within character classes.&amp;nbsp; Likewise, although the hyphen &lt;STRONG&gt;-&lt;/STRONG&gt;&amp;nbsp;is nothing special in a regular expression, it has special meaning within character classes.&lt;/P&gt;
&lt;P&gt;This is sometimes confusing, as you'll see people trying to create a ZIP+4 expression with an escaped hyphen because they&amp;nbsp;think it's a metacharacter (wrong: \d{5}\-\d{4}&amp;nbsp;&amp;nbsp; right: \d{5}-\d{4}).&amp;nbsp; Or trying to escape characters within a character class, like to match a $ or &amp;nbsp;period in a character class one might try this (wrong): &lt;STRONG&gt;[\$\.]&lt;/STRONG&gt;&amp;nbsp; instead of this (right): &lt;STRONG&gt;[$.]&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Another common misconception is that character classes can be used to match words, like expecting &lt;STRONG&gt;[img] &lt;/STRONG&gt;to match the string 'img' in a pattern.&amp;nbsp; Sure it'll match it if you give it a quantifier (&lt;STRONG&gt;[img]{3}&lt;/STRONG&gt;), but it would also match 'iii' or 'gmi' or any other 3-letter combination of those three characters.&amp;nbsp; Just remember, &lt;STRONG&gt;character&lt;/STRONG&gt; classes only refer to a single &lt;STRONG&gt;character&lt;/STRONG&gt; in the pattern -- you can't use them for words (well, not words that need to have a specific order and composition of letters, anyway).&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/ssmith/archive/2004/03/03/269.aspx&amp;amp;;subject=Regex+Character+Classes" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.aspx&amp;amp;;title=Regex+Character+Classes" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.aspx&amp;amp;title=Regex+Character+Classes" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.aspx&amp;amp;;title=Regex+Character+Classes" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.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/ssmith/archive/2004/03/03/269.aspx&amp;amp;;title=Regex+Character+Classes&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2004/03/03/269.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=269" width="1" height="1"&gt;</description></item><item><title>First Post</title><link>http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.aspx</link><pubDate>Mon, 10 Nov 2003 19:05:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:268</guid><dc:creator>ssmith</dc:creator><slash:comments>2</slash:comments><comments>http://regexadvice.com/blogs/ssmith/comments/268.aspx</comments><wfw:commentRss>http://regexadvice.com/blogs/ssmith/commentrss.aspx?PostID=268</wfw:commentRss><description>&lt;P&gt;Thanks Darren and Scott for helping get &lt;A href="http://regexadvice.com/blogs/"&gt;regexadvice.com/blogs &lt;/A&gt;set up!&lt;/P&gt;
&lt;P&gt;Steve (regex stuff will come) Smith&lt;/P&gt;
&lt;P&gt;PS - Check out &lt;A href="http://regexlib.com"&gt;RegExLib.com &lt;/A&gt;if you don't know about it!&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/ssmith/archive/2003/11/10/268.aspx&amp;amp;;subject=First+Post" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.aspx&amp;amp;;title=First+Post" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.aspx&amp;amp;title=First+Post" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.aspx&amp;amp;;title=First+Post" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.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/ssmith/archive/2003/11/10/268.aspx&amp;amp;;title=First+Post&amp;amp;;top=1" target="_blank" title = "Post http://regexadvice.com/blogs/ssmith/archive/2003/11/10/268.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://regexadvice.com/aggbug.aspx?PostID=268" width="1" height="1"&gt;</description></item></channel></rss>