I'm trying to comment out some lines in c++ by matching them with a regex, and replacing with the match preceeded by
\\. But instead, gedit performs no replacement, and the search+replace dialog gives a little
! by the replace field.
The regular expression I'm using is
^(.*kBlack[^\n]+)\n which matches correctly (any line with kBlack in). My replacement is
\\\\\1\n - i.e.
\\ to escape the second
\ and produce a single
\, repeated for two
\'s, followed by
\1 for the submatch, then a newline
\n. But no luck.
No variation in the number of starting slashes seems to give me what I'm looking for. What are the rules for properly inserting backslashes?