WTF Next?

Dev ramblings from a master of nothing.

  Home  |   Contact  |   Syndication    |   Login
  130 Posts | 0 Stories | 77 Comments | 0 Trackbacks

News

INETA Community Speakers Program
GeeksWithBlogs.net: WTFNext's hosting!

View Stacy Vicknair's profile on LinkedIn

Twitter







Tag Cloud


Archives

Post Categories

Community Links

User Groups

In Java, this is not the case as far as I know. However, when working with regular expressions in .NET, be weary of just slapping /d in when you need a number alone. Just like Char.IsDigit isn't just numbers, /d follows suit.

The reason is that /d and Char.IsDigit are both validating against the Unicode designation "Nd". This stands for number decimal digit, but does not limit itself to just 0-9.

If you're using regular expressions to begin with, you probably already realize that it is fairly easy to correct this. All it takes is to use [0-9] instead of /d.

 

posted on Tuesday, December 30, 2008 8:38 PM