Am I going mad? Yes.
-
TLDR; I found that there were non-printable characters in the replace string. Had pasted the RegEx in to Microsoft Teams wiki for future reference, then copied it back out. Apparently Teams inserts a number of U+200B ZERO WIDTH SPACE [ZWSP] characters after every opening brace.
Notepad++ Version 8.4.6 32-bit.
File format/structure is Windows (CR LF) and UTF-8.I am struggling with using RegEx and named capture groups in the Replace dialogue box when the Regular expression radio button is selected. I had a very long and complex RegEx that was working, until recently in the last week/month or so. Is there a setting that I changed to break this, or did a recent update? I ended up with a simple test case, and it failed. Here is the scenario:Given the following input text string:aab
and the following Find what string:(?<named>aa)
or(?'named'aa)
and the following Replace with string:$+{named}C
I would expect the following resulting output text string:aaCb
but instead I receive the following:Cb
orCb
.I used https://www.boost.org/doc/libs/1_78_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html#boost_regex.syntax.perl_syntax.h31, since that is the latest commit of Boost for 8.4.6. -
Nice use of
strikeout.You gave a lot of struck-out detail about what the problem turned out to NOT be, but little detail on the true problem.
Perhaps if there were more specifics about that, we’d have some suggestions about ways to avoid in the future. As it is, TS;LD (too short, lacking detail).
-
@Alan-Kilborn They updated the not-struck-out prologue minutes after your post.
-
@Neil-Schipper said in Am I going mad? Yes.:
They updated the not-struck-out prologue minutes after your post.
They probably saw my post, then updated their original, instead of adding a new post, making my first post look silly. All thanks to the genius move of making posts editable for 4 hours instead of 5 minutes.
-
@Another-github-user-2 said in Am I going mad? Yes.:
Had pasted the RegEx in to Microsoft Teams wiki for future reference, then copied it back out. Apparently Teams inserts a number of U+200B ZERO WIDTH SPACE [ZWSP] characters after every opening brace.
So what is the conclusion here?
-
Teams is at fault for adding things into your data that you didn’t want
-
Notepad++ is at fault for not showing you this extra stuff
-
something else?
-