Community
    • Login

    Syntax highlighting certain Unicode characters

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    unicodesyntax highlightcharactersregex
    7 Posts 2 Posters 1.4k Views 1 Watching
    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áng Attila D.L Offline
      Láng Attila D.
      last edited by

      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áng Attila D.L Offline
        Láng Attila D.
        last edited by

        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
        • EkopalypseE Offline
          Ekopalypse
          last edited by Ekopalypse

          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áng Attila D.L 1 Reply Last reply Reply Quote 1
          • Láng Attila D.L Offline
            Láng Attila D. @Ekopalypse
            last edited by

            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.

            EkopalypseE 1 Reply Last reply Reply Quote 0
            • EkopalypseE Offline
              Ekopalypse @Láng Attila D.
              last edited by

              @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áng Attila D.L Offline
                Láng Attila D.
                last edited by

                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.

                EkopalypseE 1 Reply Last reply Reply Quote 0
                • EkopalypseE Offline
                  Ekopalypse @Láng Attila D.
                  last edited by

                  @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

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors