Optimal Telelicious Coding From AK To CT
 
« How To Control iTunes remotely with SSH
The Monty Hall Problem »
 

Finding Duplicate Lines with Regex

If you are looking to remove duplicate lines from an alphabetized list this code will do the trick:

Find the duplicate lines

    ^(.*)(\r?\n\1)+$

Replace with a single line

    $1

Tags:

Leave a Reply