开发者

Regex to replace in files

开发者 https://www.devze.com 2023-04-12 08:03 出处:网络
I have to replace \\ in files when the \\ is not followed 开发者_如何学编程by \" so I made this regex to find occurrences with SublimeText:

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:

#[^\\]"#
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号