Community
    • Login

    Regex - Hex Code Not Working as Expected

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    9 Posts 2 Posters 350 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.
    • Sylvester BullittS
      Sylvester Bullitt
      last edited by Sylvester Bullitt

      This post is deleted!
      PeterJonesP Sylvester BullittS 2 Replies Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Sylvester Bullitt
        last edited by

        @Sylvester-Bullitt ,

        with an actual SoftHyphen, and not the ASCII hyphen that’s in your post, it works for me:

        1bfb1b83-89f4-417d-8c56-3f3a9ab1028d-image.png

        Sylvester BullittS 2 Replies Last reply Reply Quote 1
        • Sylvester BullittS
          Sylvester Bullitt @PeterJones
          last edited by

          This post is deleted!
          PeterJonesP 1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones @Sylvester Bullitt
            last edited by PeterJones

            @Sylvester-Bullitt ,

            That is the correct sequence of bytes for UTF-8 encoding of U+00AD – every character above U+007F takes at least two bytes to encode in UTF-8.

            But Notepad++ knows this, and if it reads it as UTF-8, it will display the soft-hyphen as shown in my screenshot (or as nothing, if you have View > Show Symbol > Show Non-Printing Characters turned off) – and when it is properly in UTF-8 mode (see your status bar, lower right), then it will match with the regex I showed in my screenshot.

            fuller screenshot with encoding shown:
            964341d0-c262-48b1-86e7-581ff4ef797f-image.png

            Sylvester BullittS 2 Replies Last reply Reply Quote 1
            • Sylvester BullittS
              Sylvester Bullitt @PeterJones
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • Sylvester BullittS
                Sylvester Bullitt @PeterJones
                last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • Sylvester BullittS
                  Sylvester Bullitt @PeterJones
                  last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • Sylvester BullittS
                    Sylvester Bullitt @Sylvester Bullitt
                    last edited by

                    This post is deleted!
                    PeterJonesP 1 Reply Last reply Reply Quote 0
                    • PeterJonesP
                      PeterJones @Sylvester Bullitt
                      last edited by PeterJones

                      @Sylvester-Bullitt ,

                      But when I type the same string into the forum dialog, the soft hyphen doesn’t show as it did before

                      That’s because soft-hyphen is a non-printing character, and the forum doesn’t display non-printing characters (because they have no glyph to display). As I said in my first reply, your original paste into the forum used a normal ASCII hyphen, which is why it was visible in the forum.

                      [deleted post]

                      I originally commented on your deleted post (yes, as a moderator, I can see it), but I decided to retract that part, because maybe you deleted it because you already realized what you did wrong.

                      I’m going to have to shut down for the night

                      Sounds like you need the sleep. I hope (by the time you read this) that you got it.

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