Regex to replace in files
I have to replace \
in files when the \
is not followed 开发者_如何学编程by "
so I made this regex to find occurrences with SublimeText:
#\\^"#
but it doesn't work
Do someone has an idea ?
thanks
You can't use ^
to negate a symbol. That works only for groups marked with []
to say you mean the opposite. You can use a look-ahead expression to define that the next character may not be a quote: #\\(?!")#
(Remember to escape the quote, if you use it in a string!)
You can try with following regex:
#[^\\]"#
精彩评论