@Antonsta
Unfortunately, even when the data is sorted, as you found out the regex still caused the same issue. That’s because it’s still trying to search forward over multiple line.
When the data is sorted this isn’t necessary anymore as duplicates will appear on consecutive lines.
Thus the regex can be changed to:
(?-is)^(.+)\R\K(\1$)
So this will ONLY look for 2 lines together with the same data. The use of the \K is to forget the first line so the line that gets marked is the duplicate line ONLY.
@guy038 gave a detailed rundown on this issue and ways to circumvent it. Have a look at:
https://notepad-plus-plus.org/community/topic/16489/delete-both-duplicates-regexp-macro/15?page=1
Cheers
Terry