The given solutions are wrong as it will match the following and come with a wrong result:
ABCD
ABCDE
It will duly delete both ABCD and leave the E
The correct solution is: (obvioulsy first sort the whole file alphabetically)
^(.*)(\R\1)+\R
and replace with blank (i.e. nothing)