#24096
Mr KT
Participant

Sure, just be aware that your last version, (\{\{grml\n.*?\n\}\}\n)\1 won’t match if a duplicate is the last line in the file (if there is no final “\n”). Otherwise it will do the job just fine.

This should work in Notepad++/Emeditor (issue is with the way newline is represented, so “\r?\n” should handle this), and also work if the last line is the dupe.

(\{\{grml\r?\n)(.*?\r?\n)(\}\}\r?\n?)(\{\{grml\r?\n)\2(\}\}\r?\n?)
\1\2\3