I am wondering how to move all the > CONTEXT :
line to below > BEGIN STRING
> BEGIN STRING
> CONTEXT: Actors/2/nickname/
Thunderclap of Guren
> END STRING
> BEGIN STRING
> CONTEXT: Actors/3/name/
Terence
> END STRING
> BEGIN STRING
St. knight that has been stripped of his position by the conspiracy. In order to master the true chivalry
It has repeatedly wander training the country.
> CONTEXT: Actors/3/description/
> END STRING
I can't moving up line-by-line as it will take forever because I have tons of text just like above and I want to fix it all.
EDIT : So here's what I want :
Before :
> BEGIN STRING
St. knight that has been stripped of his position by the conspiracy. In order to master the true chivalry
It has repeatedly wander training the country.
> CONTEXT: Actors/3/description/
> END STRING
After :
> BEGIN STRING
> CONTEXT: Actors/3/description/
St. knight that has been stripped of his position by the conspiracy. In order to master the true chivalry
It has repeatedly wander training the country.
> END STRING
Try with the following:
^> BEGIN STRING(\r?\n)+(?!^> CONTEXT:)\K([\s\S]*?)(> CONTEXT:[^\r\n]*)((?:\r?\n)+)?\r?\n
Replace by:
$4$3$1$2