Community
    • Login

    User Define Language

    Scheduled Pinned Locked Moved General Discussion
    6 Posts 5 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Joy HonJ
      Joy Hon
      last edited by

      Hi all,

      I would like to so a very simple of text highlighting. Below is my sample of the textfile.

      09-11:03:07.025 recv:

      05 64 05 00 05 00 01 00 3a de

      09-11:03:07.728 send:
      05 64 0b c4 01 00 05 00 08 19 c0 c5 01 01 01 06 0b 7b

      09-11:03:08.884 recv:

      05 64 10 44 05 00 01 00 d0 e2 d1 c5 81 00 00 01 01 00
      00 03 00 ec 7c

      I would like to do a simple highlight for the this text. For an example, all 05 64 will highlight with green color, 81 00 will highlight as red color.

      How can i do the highlight? I would like to make it as define your language so that i able to reuse it in the future

      1 Reply Last reply Reply Quote 0
      • Jim DaileyJ
        Jim Dailey
        last edited by Jim Dailey

        @Joy-Hon

        Here are some links:

        https://udl20.weebly.com
        http://www.thevalvepage.com/swmonkey/2015/08/19/notepad-user-defined-languages/
        https://www.apharmony.com/software-sagacity/2014/10/creating-custom-udl-user-defined-languages-in-notepad/

        1 Reply Last reply Reply Quote 3
        • PeterJonesP
          PeterJones
          last edited by

          And the UDL 2.1 docs, which most closely match what’s in the recent UDL:

          • https://ivan-radic.github.io/udl-documentation/
          1 Reply Last reply Reply Quote 3
          • Meta ChuhM
            Meta Chuh moderator
            last edited by

            @Joy-Hon

            unfortunately it’s not possible to use a numeric sequence as a keyword using notepad++'s user defined languages.

            you can’t set combinations of numbers as a keyword.
            all numeric values within the keywords section will be ignored and will be the same color you have set in the udl comment and numbers section.

            you can’t use a sequence of numbers (or letters) which are separated by a space, as they will be treated as 2 keywords.

            1 Reply Last reply Reply Quote 2
            • Joy HonJ
              Joy Hon
              last edited by

              Thank you for the information. Is that any other way to do it?

              Scott SumnerS 1 Reply Last reply Reply Quote 0
              • Scott SumnerS
                Scott Sumner @Joy Hon
                last edited by

                @Joy-Hon

                You could probably script a custom lexer without a huge amount of effort (depending upon your experience level). @PeterJones cites some good references in this thread – see where it says "various custom lexers written in PythonScript: "

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors