在记事本++的每一行的最后一个\处添加一个字母

时间:2020-06-03 17:59:53

标签: regex notepad++ line add letter

我想在Notepad ++的每一行的最后\之前添加一个字母,如下所示:

之前:

product\190\1017\evita-cover-art.jpg

之后:

product\190\1017b\evita-cover-art.jpg

因此,字母b被添加到最后一个\之前,

有很多行,因此我可能会使用find和regex替换。

1 个答案:

答案 0 :(得分:0)

  • Ctrl + H
  • 查找内容:\\[^\\]*$
  • 替换为:b$0
  • 检查 环绕
  • 检查 正则表达式
  • 全部替换

说明:

\\          # a backslash
[^\\]*      # 0 or more any character that is not a backslash
$           # end of line

替换:

b           # literally
$0          # content of group 0 (i.e. the whole match)

屏幕截图(之前):

enter image description here

屏幕截图(之后):

enter image description here

相关问题