• Login
Community
  • Login

Am I going mad? Yes.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 3 Posters 515 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.
  • A
    Another-github-user-2
    last edited by Another-github-user-2 Oct 31, 2022, 8:30 PM Oct 31, 2022, 7:57 PM

    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.

    A 2 Replies Last reply Oct 31, 2022, 8:23 PM Reply Quote 1
    • A
      Alan Kilborn @Another-github-user-2
      last edited by Oct 31, 2022, 8:23 PM

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

      N 1 Reply Last reply Nov 1, 2022, 4:23 AM Reply Quote 0
      • N
        Neil Schipper @Alan Kilborn
        last edited by Nov 1, 2022, 4:23 AM

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

        A 1 Reply Last reply Nov 1, 2022, 11:26 AM Reply Quote 1
        • A
          Alan Kilborn @Neil Schipper
          last edited by Nov 1, 2022, 11:26 AM

          @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
          • A
            Alan Kilborn @Another-github-user-2
            last edited by Nov 1, 2022, 11:28 AM

            @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
            5 out of 5
            • First post
              5/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors