如何在Notepad ++中的文件的开头和结尾添加内容?

时间:2014-11-14 10:28:10

标签: python notepad++

我需要找到一个正则表达式或PythonScript函数来在第一行的第一个字符之前和最后一行的最后一个字符之后添加文本。有什么想法吗?

2 个答案:

答案 0 :(得分:0)

怎么样:

找到:(.+)
替换为:DEBUT$1FIN

确保选中Regular ExpressionDot matches newline 然后clic on 全部替换

答案 1 :(得分:0)

这适用于PythonScript

// Add the text "foo" before the first character
editor.insertText(0, "foo")
// Add the text "bar" after the last character
editor.insertText(editor.getLength(), "bar")
相关问题