我有一个很大的txt文件,有很多字符串,比如说“string-I-want-to-change”,现在我需要将所有字符串改为:
string-insert-before-string-I-want-to-change-string-insert-after
我的意思是,找到一个模式,在模式之前和之后插入一些东西,但只保留模式。我尝试了很多方法,他们只是用我想插入的字符串替换了模式。
我在这里尝试了这个方法 Using RegEX To Prefix And Append In Notepad++
在这里
regular expression to add characters before and after numbers
但它们似乎与我的版本的notepad ++不兼容,我使用的是最新版本的6.1.2
有人请帮帮我:) 谢谢!
答案 0 :(得分:2)
这对你有用。
find : (string-i-want-to-change)
replace : string-in-front-of-it-\1-string-after-it
测试字符串:
other-strings-came-in-front-of-it-string-i-want-to-change-and-it-continues-like-that
输出:
other-strings-came-in-front-of-it-string-in-front-of-it-string-i-want-to-change-string-after-it-and-it-continues-like-that