Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Syntax highlighting certain Unicode characters

    Help wanted · · · – – – · · ·
    unicode syntax highligh characters regexp
    2
    7
    327
    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á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á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
        • Ekopalypse
          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. 1 Reply Last reply Reply Quote 1
          • Láng Attila D.
            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.

            Ekopalypse 1 Reply Last reply Reply Quote 0
            • Ekopalypse
              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á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.

                Ekopalypse 1 Reply Last reply Reply Quote 0
                • Ekopalypse
                  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
                  • First post
                    Last post
                  Copyright © 2014 NodeBB Forums | Contributors