Geeks With Blogs

News INETA Community Speakers Program WTFNext's hosting!

View Stacy Vicknair's profile on LinkedIn

WTF Next? Dev ramblings from a master of nothing.

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 .NET Tips | Back to top

Comments on this post: .NET Tip: Regular expression "/d" is more than just 0-9

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Stacy Vicknair | Powered by: