Notepad++ 添加到每一行

标签 notepad++

我正在使用 Notepad++,但我无法弄清楚:

我有很多行都以 http 开头。我需要在每一行的前面添加一些文本。另外,我需要在每行末尾添加不同的文本。每行的结尾都不同。

向每行的开头和结尾添加文本的最快方法是什么?

最佳答案

请按照以下步骤操作:

  1. Ctrl+H 调出查找/替换对话框。
  2. 选择对话框底部附近的正则表达式选项。

要在每行的开头处添加一个单词,例如test:

  1. Type ^ in the Find what textbox
  2. Type test in the Replace with textbox
  3. Place cursor in the first line of the file to ensure all lines are affected
  4. Click Replace All button

要在每行的末尾添加一个单词,例如test:

  1. Type $ in the Find what textbox
  2. Type test in the Replace with textbox
  3. Place cursor in the first line of the file to ensure all lines are affected
  4. Click Replace All button

关于Notepad++ 添加到每一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11003761/

相关文章:

autocomplete - Notepad++ 自动完成多个文件(整个项目)

styles - Notepad++ 风格注释带有/**

utf-8 - 如何使用 Notepad++ 将 ANSI 编码文件转换为 UTF-8?

html - 如何在 Notepad++ 中自动格式化/缩进 XML/HTML

正则表达式帮助 - 查找直到前一个空格字符的所有内容

php - 在两个字符之间获取

plugins - Notepad++ Rtf 编辑插件

autocomplete - Notepad++:在评论中禁用自动完成

ruby - 如何在 IRB 中加载 ruby​​ 脚本?

正则表达式 - 跳过前 12 个字符