Using EmEditor, I want to delete all the repeated instances of a string that occupies the full line plus the line above it. For example, in this text the repeated string is Cyperus esculentus (it could be anything else) and I want all its repeated instances deleted, including the previous line, i.e. language code. So far, what I figured out is something like this:
.{2,3} \nCyperus esculentus\n
But the problem is that I have to replace the repeated string with the one that is repeated in each different text.
ar 
سعد لذيذ
ast 
Cyperus esculentus
azb 
یئمهلی توپالاق
az 
Yeməli topalaq
bo 
ཆུ་འབྲུམ།
ca 
Xufa
ceb 
Cyperus esculentus
cs 
Šáchor jedlý
de 
Erdmandel
en 
Cyperus esculentus
eo 
Cyperus esculentus
es 
Cyperus esculentus
eu 
Bedaur
fa 
اویار سلام زرد
fr 
Souchet comestible
gl 
Xunca doce
ha 
Aya
he 
גומא נאכל
id 
Cyperus esculentus
it 
Cyperus esculentus
ja 
ショクヨウガヤツリ
la 
Cyperus esculentus
nl 
Knolcyperus
nv 
Tłʼohigaaí
pl 
Cibora jadalna
pt 
Cyperus esculentus
ru 
Чуфа
srn 
Affo
sv 
Jordmandel
th 
แห้วไทย
tr 
Yer bademi
uk 
Смикавець їстівний
uz 
Yerbodom
vi 
Củ gấu tàu
war 
Cyperus esculentus
zh 
油莎草
The expected result is what is left after applying the regex I mentioned above (to clarify, in these texts there is only one string that can is repeated, so the regex does not have to look for multiple different repeated strings):
ar 
سعد لذيذ
azb 
یئمهلی توپالاق
az 
Yeməli topalaq
bo 
ཆུ་འབྲུམ།
ca 
Xufa
cs 
Šáchor jedlý
de 
Erdmandel
eu 
Bedaur
fa 
اویار سلام زرد
fr 
Souchet comestible
gl 
Xunca doce
ha 
Aya
he 
גומא נאכל
ja 
ショクヨウガヤツリ
nl 
Knolcyperus
nv 
Tłʼohigaaí
pl 
Cibora jadalna
ru 
Чуфа
srn 
Affo
sv 
Jordmandel
th 
แห้วไทย
tr 
Yer bademi
uk 
Смикавець їстівний
uz 
Yerbodom
vi 
Củ gấu tàu
zh 
油莎草
This is what worked for me
document.selection.StartOfDocument(false);
document.DeleteDuplicates("",eeIncludeAll);
document.selection.Replace("([a-z]{2,3} \\n)([a-z]{2,3} \\n)","\\2",eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp,0);
document.selection.Replace("([a-z]{2,3} \\n)([a-z]{2,3} \\n)","\\2",eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp,0);
document.selection.Replace("([a-z]{2,3} \\n)([a-z]{2,3} \\n)","\\2",eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp,0);
