我正在使用 Notepad++,但我无法弄清楚:
我有很多行都以 http
开头。我需要在每一行的前面添加一些文本。另外,我需要在每行末尾添加不同的文本。每行的结尾都不同。
向每行的开头和结尾添加文本的最快方法是什么?
最佳答案
请按照以下步骤操作:
- 按 Ctrl+H 调出查找/替换对话框。
- 选择对话框底部附近的
正则表达式
选项。
要在每行的开头处添加一个单词,例如test
:
- Type
^
in theFind what
textbox- Type
test
in theReplace with
textbox- Place cursor in the first line of the file to ensure all lines are affected
- Click
Replace All
button
要在每行的末尾添加一个单词,例如test
:
- Type
$
in theFind what
textbox- Type
test
in theReplace with
textbox- Place cursor in the first line of the file to ensure all lines are affected
- Click
Replace All
button
关于Notepad++ 添加到每一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11003761/