UDL doesn't work as wanted
-
Hi all,
I created a User Defined Language for analyzing logfiles. In the “Keyword Lists” I created a Styler containing “-140”, “(-140)” and “<-140>”:
But for the analysis, not all “-140” are matched:
A few lines later there is no highlighting of “-140”:
Does someone have an idea what I did wrong?
-
That’s because
'<-140>'
is not the same sequence as<-140>
, so it doesn’t match. The lexer uses full tokens, and if you merge things together without spaces, it will treat them differently than if there are spaces between.If you go to the Delimiters tab, and add
'
as the Delimiter # style (# of your choice), then go into that entry’s styler, and enable nesting, then it will be able to recognize things inside the'
marks as something to process, tooNo nesting:
With nesting:
Or, without setting the single quotes as delimiters, if you had spaces between the
'
and the(-140)
, so that the parser would treat(-140)
as a separate token, it would recognize it as well:
In my example, I changed the styling of the
'
delimiter to make it obvious, but if you don’t want the'
portion highlighted in any way, don’t set any of the styles, but just set the nesting. Remember to nest anything that might end up inside those pairs.BTW: you’ll notice that
-140
on its own doesn’t get highlighted either. That’s because the UDL lexer recognizes it as a number, and thus highlights it as a number rather than as a keyword. -
@PeterJones said in UDL doesn't work as wanted:
Delimiter
Thank you very much Peter! That helps:
With these settings, the matches are correct shown in the whole logfile!
Kind regards,
Juergen