I want to copy a word/string below in a line above. For example I want to copy TWO-2
from the second line into the first line, replacing the word ONE-1
BEBE ONE-1 NERO
text text
OANA TWO-2 BOGDAN
MUST BECOME
BEBE TWO-2 NERO
text text
OANA TWO-2 BOGDAN
In other case, I have something like this:
html code ... several lines
text <p> BEBE ONE-1 NERO <div> text...
other html code ... several lines
text <table> OANA TWO-2 BOGDAN <tr> text
again html code ... several lines
MUST BECOME:
html code ... several lines
text <p> BEBE TWO-2 NERO <div> text...
other html code ... several lines
text <table> OANA TWO-2 BOGDAN <tr> text
again html code ... several lines
My regex is very close to a simple solution, but I believe the replacement is not very good:
FIND (.matches newline): (BEBE(.*?)NERO.*?)(OANA(.*?)BOGDAN)
REPLACE BY: \4\1\3\2