1

I have a big txt file ,with many strings ,say "string-I-want-to-change",now I need to change all of them into this :

string-insert-before-string-I-want-to-change-string-insert-after

I mean ,find a pattern ,insert something before and after the pattern ,but just keep the pattern.I tried many ways ,they just replaced the pattern with the string I want to insert.

I tried the method here Using RegEX To Prefix And Append In Notepad++

and here

regular expression to add characters before and after numbers

But they seem do not work with my version of notepad++,I am using the newest version 6.1.2

Some one please help me :) Thank you!

Community
  • 1
  • 1
NextStep
  • 1,035
  • 3
  • 14
  • 18

1 Answers1

2

This would work for you.

find : (string-i-want-to-change)

replace : string-in-front-of-it-\1-string-after-it

test string :

other-strings-came-in-front-of-it-string-i-want-to-change-and-it-continues-like-that

output :

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

Taha Paksu
  • 15,371
  • 2
  • 44
  • 78