Plugin or UDL to color whole lines by regexp?
-
I’m looking for either a Notepad++ plugin, or a User-Defined Language, that will allow me to color lines in a file by regexp.
E.g. a line containing “ERROR” (anywhere in the line) should be red, and a line containing “code [0-9]+” should be green (the whole line, not just the regexp).This appears quite simple (is it though?) yet I haven’t been able to locate any solution. “AnalysePlugin” comes close, but it doesn’t color the file itself but rather displays the lines in a separate window. I want the coloring to be like syntax highlighting.
Does such a thing exist?
Thanks in advance! -
If by “color lines” you mean you want to change the foreground color, then you could probably use the EnhanceAnyLexer plugin:
Assuming it’s a Normal text file, you would use Plugins > EnhanceAnyLexer > Enhance Current Language, and the plugin will add a section to its
.ini
file called[normal text]
with an example pair of color (on the left of the equal) and regex (on the right of the equal).If you were to enter
0x0000FF = ^.*ERROR.*$ 0xFF0000 = ^.*code [0-9]+.*$
in the
.ini
file it opens, then when you switch to your text file, the textred blah Something ERROR something blah code 1234 here
would look like
-
@PeterJones Thank you! That is exactly what I needed.