How can I search in Visual Studio and get it to ignore what is commented out?

后端 未结 8 554
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-02 09:20

I am refactoring a C++ codebase in Visual Studio 2005. I\'m about half way through this process now and I\'ve commented out a lot of old code and replaced or moved it. Now I\'

8条回答
  •  猫巷女王i
    2021-02-02 09:56

    In Visual Basic within Visual Studio 2015, I was able to search for text outside of comments by adapting glassiko's comment from the most upvoted answer

    ^(?![ \t]*[']).*mysearchterm
    

    And in C# you would use glassiko's comment exactly as it was

     ^(?![ \t]*//).*mysearchterm
    

提交回复
热议问题