Regex - Hex Code Not Working as Expected
-
This post is deleted! -
with an actual SoftHyphen, and not the ASCII hyphen that’s in your post, it works for me:
-
This post is deleted! -
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:
-
This post is deleted! -
This post is deleted! -
This post is deleted! -
This post is deleted! -
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.