UDL for Log files
-
I try to define a UDL for some kind of LOG-files. So it should be rather simple, no bracket intention and all that stuff
Nevertheless I have some questions:
a)
It highlights number only when the are alone “1” or “123.45”. But it does not mark them when they are side by side with other characters: “1+2=3”, “version21”
How to highlight every number?b)
How to highlight strings as parts of other strings, like “check”: in “upCHECKer” or “CHECKed” or “NumberCHECKing”c)
I used (tried to use) quotes with German Umlaute, like “grosse Mühle” or “ärgerlicher Fehler”. It seems that these words are only accepted without quotes - correct?d)
Final blanks are not accepted with quotes. “Where are Joe and” works fine. "Where are Joe and " are not accepted as multipart keyword. Correct?Thanks and regards!
-
FYI: In Notepad++ UDL configurator unfortunately doesn’t support regular expressions though this would help in a lot of cases like yours. But you could try the Analyse Plugin (availabel via built-in Plugins Admin). It has been especially developed for analysing log files and supports regular expressions. Could be a better approach for you than fiddling around with UDL configuration.
-
thanks. It’s an interessting feature, but in my special case a highlighting seem to be better.
-
UDL has been designed to support highlighting of programming languages, your use case is a little bit different to this.
At the moment I see 3 ways to make this work.- You write your own lexer
- You use a scripting plugin and enhance the already defined UDL with the missing features.
- By using a slightly different approach like the one mentioned by dinkumoil.
When you want to make either 1 or 2 work, there is, for example, the PythonScript plugin which has a logfile lexer as an example script.
In addition, I described here how one can enhance an already defined UDL with pythpn and regex.