WTF Next?

Dev ramblings from a master of nothing.

  Home  |   Contact  |   Syndication    |   Login
  126 Posts | 0 Stories | 74 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

Regular Expressions

There are 2 entries for the tag Regular Expressions
This post is mostly inspired by a question I came across in the MSDN forums. Basically, say we had a set of data in a string that looked something like this and we just HAAAAAD to use regular expressions to get the info out (I’m insinuating maybe string.split would work better in this situation…) Dim dataToSearch As String = "-Cat-Dog-Meese-Chardonnay-" Well, the pattern is simple right? Just throw in a regex for "-[A-Za-z]+-" and we’re good to go. Dim reg As New Regex("-[A-Za-z]+-") For Each m As...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

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...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati