Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Match a digit in Visual Studio with regular expressions

How do I match a digit in Visual Studio?

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

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

like image 938
Bryan Avatar asked Dec 17 '22 08:12

Bryan


2 Answers

Here are the Regular Expressions that it recognizes. Read this great article on the Visual Studio Regular Expressions by Jeff Atwood.

alt text
(source: codinghorror.com)

like image 118
Jose Basilio Avatar answered Jan 03 '23 11:01

Jose Basilio


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.

like image 21
Jon Skeet Avatar answered Jan 03 '23 10:01

Jon Skeet