I need to search all of my codebase for \"Url\" and replace it with \"URL\". If I search for Url in Visual Studio I also get all my variables with \"Url\" in it.
Anyone
Visual Studio has a "quoted string" operator :q
. If you search for :qUrl
with 'Use: Regular expressions' and 'Match case' on, it should find all instances of "Url" only in strings.
Update: The above is incorrect. :q just searches for a quoted string, but you can't put anything into it. My testing was just showing cases that looked correct, but were just coincidentally correct. I think instead, you want something like:
^(:q*.*)*(("[^"]*Url[^"]*")|('[^']*Url[^']*'))(:q*.*)*$