own language: handling for special characters
-
I’ making an own language highlighter for a special log file and have the problem that the trigger words contain special characters that NPP simply ignores.
Example log text:
2017-12-34 [1] INFO starting 'foo!bar', version 1.2.3.4 ... 2017-12-34 [1] INFO closing foo!bar (exiting main thread)
Now, I put the trigger
"] INFO starting 'foo!bar', version"
as start in text block, here: text block code 2, and also
"] INFO closing foo!bar"
in the end box in text block code 2.
Also, key words are ignored if they doesn’t stand alone (foo bar works, [foo bar] not.).
Well, doesn’t work. Also, escaping the characters -, /, ", ', … with a leading backslash doesn’t work.Now, what is the exact syntax for escaping special characters?
And also: How can I add two empty lines as trigger for ending a folded block?
-
@Jan-Kischel
Sorry, I don’t quite understand what you are trying to do. I assume you are using the UDL feature.If you want a keyword to show up when it is adjacent to certain special characters like “[”, “]”, “{”, and “}”, you can try adding those characters to the Operators group.
-
Sorry, I don’t quite understand what you are trying to do.
Basically, I try to make a special kind of log file more readable using the user defined language feature.
I want to utilize the folding feature as my log file contains some sessions I want to ‘group’. It the same as an
if { code here }
block in JavaScript.
Now, imagine “starting ‘foo!bar’, version” instead of “if” as starting mark. I added
! ’ " * # \ / _ - + : ;into my operators, but doesn’t work.Or, to be more clear:
I want NPP to and handle every line as a stupid raw string, no matter what characters are in it.
(alternatively, a nice regex would be welcome, but NPP doesn’t support regex in keywords, I guess due to performance.)