

The syntax (?:\h \1) stands for the possible common part, repeated one or more times, and separated by possible spaces and/or tabulations. The part to keep (.+?) represents the smallest string, eventually repeated, which will be rewritten, due to the syntax \1, in the replacement zone The data is consecutive down the rows with A & D being a. The \h syntax matches less characters than the \s form. The issue: I have 6 total columns of data, A:C represents 2014 and D:F represents 2015. If repeated sequences can't be found, in a line, the current line is considered to be an unique sequence of all its characters !įor a correct behaviour of the regex, it's better to use the two anchors ^ and $ It can be accessed with Edit Line Operations Remove Consecutive Duplicate Lines. In the lookup box, type 'duplicate' Click the Use button to load the 'delete duplicate lines' regex. Select the Regular expression search mode As of Notepad++ v7.7.1, Notepad++ has a feature called Remove Consecutive Duplicate Lines which does the same thing as the other two solutions given below (i.e. However, my regex needs a condition: the last line ( as the string iii, in the above example ) must be followed by its EOL character(s) Notes : The first part (-s)(. On the Library tab, load the RegexBuddy.rbl library if not loaded by default. In addition, this regex, trims all possible leading and trailing spaces / tabulations. If you are creating lists or source code, your lines often begin the same and line auto-completion can ease the usual copy-pasting. This feature offers you to auto-complete beginnings of frequent lines, including indentation, punctuation and other characters.


Abc 123 defg abc 123 defgabc 123 defg abc 123 defg Use this regex in the replace window in Notepad++, and dont forget to select Regular expression as the Search Mode option below: Ctrl + H Find what: (. Line auto-completion, a bit innovative, is based on lines of the current document.
