Regular Expressions for Visual Studio Code Analysis

By Michael Flanakin @ 1:30 PM :: 1441 Views :: 1 Comments :: .NET 2.0 :: Digg it!

The following is a work in progress. My hopes are to package all of this up in a Visual Studio add-in, but that will be dependent on whatever time I have available, of course.

As I've mentioned before, I'm going thru a lot of code analysis warnings and something came up that a regex find/replace would fix fairly easily. That, of course, got me thinking about how code analysis needs to have built-in refactoring capabilities. Whether or not you realize it, Visual Studio's find/replace regex is non-standard. As annoying as it is, at least I'm able to do most of what I need by going thru the online help. I'm glad I did because I now know how to do a few things I didn't think were possible, like replacement substitutions. With that in mind, here are a few of the ones I've been using to automate code analysis fixes. Before I get to that, tho, let me say that I'm no regex expert, so some of these might need further perfection. If anyone has any comments, corrections, or suggestions, I'd love to hear them!

Ratings

Comments

By Joben.Rara.blogs(".NET") @ Monday, June 25, 2007 11:22 AM

Click here to post a comment



Categories Categories