Match a number in Visual Studio with regular expressions

How do I match a number in Visual Studio?

My first guess is \d , but it does not work for me.

Secondly, is there a list of special characters in Visual Studio?

+4
source share
7 answers

According to the MSDN docs for regular expressions Visual Studio,: :d .

Here also :z , which corresponds to one or more digits, i.e. used to match an integer.

And yes, VS Regular Expressions are fancy .

+3
source

Here are the regular expressions that he recognizes. Read this great article on Jeff Atwood's Visual Studio Regular Expressions .

alt text http://www.codinghorror.com/blog/images/visual-studio-2005-find-dialog-builder.png

+4
source

This might work if you try [0-9] .

+2
source

Well, if you just need to match literally numbers, you can use a range, for example [0-9] +

+1
source

There is a little to the bottom right of the search box, which will show you the standard notation used in the VS search utility. This is a large arrow pointing to the right.

You can use: z for numbers (and make sure the regular expression checkbox is selected :).

+1
source
+1
source

How to combine the number depends on the version of Visual Studio 1 :

Regarding the second question, there is a list of special characters in Using Regular Expressions in Visual Studio (for both new and old syntax).

1 Using Regular Expressions in Visual Studio (MSDN)

0
source

All Articles