Visual Studio Find and Replace Regular Expressions
Find lines with quoted strings, not containing strings include or trace
I am tryling to find out all lines in c++ project that contains some text
as I have to use visual studio, I have to use its Find and Replace
http://www.codinghorror.com/blog/2006/07/the-visual-studio-ide-and-regular-expressions.html
so, for finding all lines like: print(“abc”); it is enogh to write
:q
and it will find all quoted strings
ok, but I also get lot of lines like #include “stdio.h” and trace(“* step 1 *“)
I find out regex to get all lines containing include and trace
<include|trace>
So, my question is: How to find all lines with “quoted strings”
but NOT lines that contains strings include and trace?
Try this:
~(whatever)is how VS does negative lookahead. This matches from the start of the line to end of the last quoted string on that line. If you want to match the whole line, you can do that, too:Note that this will exclude lines containing the words “include” and “trace” even if they’re inside a quoted string.