Regular Expressions 101

Community Patterns

Community Library Entry

3

Regular Expression
Created·2015-12-04 13:34
Flavor·PCRE (Legacy)

/
^(.*?)$\s+?^(?=.*^\1$)
/
gms
Open regex in editor

Description

"dot matches newline" must be activated. Search and replace by "" (empty string) removes duplicate lines anywhere in text.

Example for Notepad++ use shown under http://stackoverflow.com/questions/3958350/removing-duplicate-rows-in-notepad

Submitted by Stackoverflow user stema