Community
    • Login

    Unicode characters as delimiters in UDL

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 346 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.
    • MarionM
      Marion
      last edited by Marion

      Hi,

      Is there a way to use special (Unicode) characters as delimiters in a UDL? I know Notepad++ doesn’t natively support this, but I’m wondering if it’s possible with plugins.

      I’ve installed and fiddled around with EnhanceAnyLexer, as suggested by the Notepad++ User Manual, but as far as I can see (which isn’t very far, to be sure) it seems to allow only the coloring of Unicode strings themselves.

      What I’m trying to do is to use double curly quotes, as in this post:
      https://community.notepad-plus-plus.org/topic/23774/simple-udl-highlighting-apostrophes-quotation-marks
      Except in my case I’d like to use them as delimiters – so that the custom style applies not only to the curly quote characters themselves, but all the text encased between matching curly quotes.

      Thanks!

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Marion
        last edited by PeterJones

        @Marion ,

        EnhanceAnyLexerConfig.ini

        [normal text]
        0x00FF00 = “.*?”|‘.*?’
        ; but only if the matches are not already styled by one of the IDs in excluded_styles.
        ; check in the respective styler xml if the following IDs are valid
        excluded_styles = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20,21,22,23
        

        blah.txt

        “hello”
        normal
        ‘there’
        normal
        

        highlighting:
        66485316-a697-4c06-8ff2-c3cbb77088e4-image.png

        If you want it to work for multiline strings, change the config line to

        0x00FF00 = (?s)(“.*?”|‘.*?’)
        
        MarionM 1 Reply Last reply Reply Quote 2
        • MarionM
          Marion @PeterJones
          last edited by

          @PeterJones This is perfect – thank you so much for your help!

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