Community
    • Login

    Am I going mad? Yes.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 475 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.
    • Another-github-user-2A
      Another-github-user-2
      last edited by Another-github-user-2

      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 or ​Cb.

      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.

      Alan KilbornA 2 Replies Last reply Reply Quote 1
      • Alan KilbornA
        Alan Kilborn @Another-github-user-2
        last edited by

        @Another-github-user-2

        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).

        Neil SchipperN 1 Reply Last reply Reply Quote 0
        • Neil SchipperN
          Neil Schipper @Alan Kilborn
          last edited by

          @Alan-Kilborn They updated the not-struck-out prologue minutes after your post.

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Neil Schipper
            last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • Alan KilbornA
              Alan Kilborn @Another-github-user-2
              last edited by

              @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?

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