Search code examples
regexnotepad++emeditor

Find lines that do not contain 1 of 2 characters in Notepad++


how can i find lines that NOT contain either chars ; or :?

i only know to find line without one of them by regex ^[^\:]*\r\n

thanks!


Solution

  • With the following, you can select blocks of consecutive lines that do not contain those characters:

    ^[^:;]*$
    

    For the following input file, this regular expression will select lines 1-2, 4-6, 8-9 (skipping line 3 and 7, which contain the excluded characters).

    1
    2
    3A : 3B
    4
    5
    6
    7A ; 7B
    8
    9