I need to find all occurrences of AAsomeArbitraryStringBB and replace it with CCsomeArbitraryStringDD.SoAAHelloBBTextAAByeByeBBbecomesCCHelloDDTextCCByeByeDD.It's important to note that the replacement string contains part of the search string.
Search and Replace question
text processing;sed;search;replace
This is basic task for sed command:sed 's/AA\(someArbitraryString\)BB/CC\1DD/g'Eventually if you want to do this for all arbitrary strings:sed 's/AA\(.*\)BB/CC\1DD/g'