• Login
Community
  • Login

Syntax highlighting certain Unicode characters

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
unicodesyntax highlightcharactersregex
7 Posts 2 Posters 873 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.
  • L
    Láng Attila D.
    last edited by Oct 5, 2019, 10:28 PM

    Hi. I’m proofreading some OCR’ed text in NPP and it contains some Cyrillic (among other things). Since several Cyrillic letters are of exactly the same shape as certain Latin letters, but of course they go by different code, I would like to syntax highlight them to be sure what am I seeing. Is that possible, please?

    1 Reply Last reply Reply Quote 0
    • L
      Láng Attila D.
      last edited by Oct 6, 2019, 1:03 AM

      NB. For the time being, I quasi-solved it by creating a delimiter style to highlight between characters { and } and performed a regex replacement of [complete cyrillic alphabet here]+ to {$0} thus enclosing any Cyrillic character or word between { } braces. But this isn’t very nice of course.

      1 Reply Last reply Reply Quote 0
      • E
        Ekopalypse
        last edited by Ekopalypse Oct 7, 2019, 10:53 AM Oct 7, 2019, 10:53 AM

        Cannot be solved via UDL, afaik.
        Two possible solutions might be to mark the regex matches instead of replacing it (4th tab of find/reaplce dialog)
        or to use a scripting plugin like pythonscript, lua script … to write your own quasi-lexer.

        L 1 Reply Last reply Oct 7, 2019, 12:41 PM Reply Quote 1
        • L
          Láng Attila D. @Ekopalypse
          last edited by Oct 7, 2019, 12:41 PM

          Sorry to hear that, @Ekopalypse, but actually, I know nothing of either Python or Lua, nor about the programming of NPP. So, this won’t be solved. Thank you for letting me know.

          E 1 Reply Last reply Oct 7, 2019, 12:44 PM Reply Quote 0
          • E
            Ekopalypse @Láng Attila D.
            last edited by Oct 7, 2019, 12:44 PM

            @Láng-Attila-D

            I hope we haven’t misunderstood each other but

            mark the regex matches instead of replacing it (4th tab of find/reaplce dialog)

            doesn’t involve any programming and doesn’t manipulate your text either.

            1 Reply Last reply Reply Quote 1
            • L
              Láng Attila D.
              last edited by Oct 7, 2019, 5:43 PM

              Oh, I see. I wasn’t aware about that function. Well, it’s nice, too. The only problem is that it doesn’t remain so after reopening the document. Well, better than nothing. Thank you.

              E 1 Reply Last reply Oct 7, 2019, 7:35 PM Reply Quote 0
              • E
                Ekopalypse @Láng Attila D.
                last edited by Oct 7, 2019, 7:35 PM

                @Láng-Attila-D

                strictily speaking, UDL does not remain too but get automatically reapplied.
                One further thing you can do is to record a macro, save the action and assign
                a shortcut then you have to just press that shortcut and the regex marks get reapplied as well.

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