How do I match a digit in Visual Studio? My first guess: \d is not working for me. I s there a list of special characters in visual studio?
+1
A:
Well, assuming you just need to match literally numbers, you could use a range like [0-9]+
EvanK
2009-05-01 16:34:46
+1
A:
There's a little drop down to the right of the find box that will show you the regular expression notation used in the VS find utility. It's the big arrow pointing to the right.
You can use :z for digits (and make sure you have the regex checkbox checked :).
Mike
2009-05-01 16:35:11
+2
A:
According to the MSDN docs for Visual Studio's regular expressions, it's :d
.
There's also :z
which matches one or more digits, i.e. used to match an integer.
And yes, VS regexes are bizarre.
Jon Skeet
2009-05-01 16:35:43
That's only a partial list. From the docs: "The list of all regular expressions that are valid in Find and Replace operations is longer than can be displayed in the Expression Builder." In particular, that doesn't show :d for digit...
Jon Skeet
2009-05-01 16:40:16
A:
Download Expresso - It is a good GUI tool for learning - trying regexes ( has C# support with code generation). Here is a link to a table with the VS regex rools
YordanGeorgiev
2009-05-01 17:11:39