notepad++

Find lines exceeding a certain length in Notepad++


I wonder whether it is possible to work out the maximum length per line in Notepad++ and highlight only those lines exceeding a certain threshold. I know there is a way to do it indirectly by customizing the vertical edge, but it would not be feasible if you have a long document to scroll.


Solution

  • You can look for lines longer than a given threshold as follows:

    Edit -> Find -> Select "Regular expression" in "Search Mode", look for .{x,} where x is your desired threshold (e.g. .{15,} to look for lines that are 15 characters or longer).

    . is a wild-card and {x,} means x or more of what appears before it, so .{x,} means x or more of any combination of characters.

    Also make sure that the . matches newline option is not checked, otherwise it won't work.

    I'm not sure if this helps, but that's about as much as you can do only using Notepad++.