• Login
Community
  • Login

Unicode characters as delimiters in UDL

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 345 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.
  • M
    Marion
    last edited by Marion Mar 6, 2024, 8:40 AM Mar 6, 2024, 8:34 AM

    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!

    P 1 Reply Last reply Mar 6, 2024, 2:06 PM Reply Quote 0
    • P
      PeterJones @Marion
      last edited by PeterJones Mar 6, 2024, 2:07 PM Mar 6, 2024, 2:06 PM

      @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)(“.*?”|‘.*?’)
      
      M 1 Reply Last reply Mar 6, 2024, 7:53 PM Reply Quote 2
      • M
        Marion @PeterJones
        last edited by Mar 6, 2024, 7:53 PM

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

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