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!

1
  • 2
    Could you provide an example input and output and the code you used? Commented May 10, 2012 at 16:35

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.