I posted a macro a few years ago that rapidly de-dupes a list, but also extracts the dupes:
Using the long list in that demo (240 words), it takes it about 0.3 seconds to process and display all three lists (original, dupes, and de-duped). No regex at all, no Javascript, just two Unix commands (sort and uniq).