Range Comand of Numbers in UDLdidn't work



  • Hi Guys,
    I’m working long time with Notepad++ and it’s a great tool. Today I’ve started do define an UDL for an internal used skript.
    It all works fine until I want to define the Numbers…

    The goal is to highlight all Numbers without 0 in RED

    • So Highlight all in RED (this is easy and was done by define the Style in the section Numbers)
    • Don’t Highlight 0 (that’s the hard one…)
      I’ve used the Range to advice unsing only a special area, but wihtout sucsess. It seem to me that this command didn’t work anyway (see screenshoot of a test)
      b5e8220e-f2ef-44a5-8be6-45d5f1653bbf-image.png
      I’ve tried as well 1::5 or 1->5 like deskripted by Ivan (https://ivan-radic.github.io/udl-documentation/numbers/) but without sucsess
      The other stuff like Präfix or Suffix works…

    scond level would be If I would be able to have all Numbers in RED and the 0 in GREEN. I tried to use Keywords (like I’ve done it before for some comands), but It looks like this didn’t work with Numbers.

    I hope someone can show me an easy solution for this

    Thanks in advance



  • Hello, @hans-gerch and All,

    The Range field ( Bereich ) is not intended to define the range of numbers

    It’s just a kind of suffix-prefix symbol(s) which will be highlighted, like the numbers placed right before and, possibly, the numbers located right after

    For instance, if that Range zone contains - :: __ ( a single dash, a double colon or a double underscore chars ), this means that, for instance, all the strings, below, will be highlighted in red

    2-0.5
    100::47
    0.003__7.785
    0000::
    

    Now, I’m not very acquainted with UDL and I don’t see an obvious way to distinguish the digit 0 from the other digits ! I’m afraid that it cannot be do with the native N++ UDL feature.

    However, you could use an enhanced UDL lexer, which could manage, differently, the 0 digit from the others. Two conditions :

    Best Regards,

    guy038


Log in to reply