Community
    • Login

    Search++ (\W)'(\w) regex replace failure

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    3 Posts 2 Posters 41 Views 1 Watching
    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.
    • M Andre Z EckenrodeM Online
      M Andre Z Eckenrode
      last edited by

      @Coises

      As noted in my post earlier today about an instance of regex replacement failure via Notepad++’s native find/replace functionality, I tried doing the same regex replacement in Search++, but got some bizarre results. As stated in my other post, I was doing this in ANSI text, using FIND WHAT string (\W)'(\w) and REPLACE WITH string \1’\2. My initial text:

      this
      'Cos I am
      that
      
      this
      'Round and 'round
      that
      

      Considering your explanation to me in the other thread, I’m assuming my utilization of the same regex via your plugin may have been doomed to failure anyway, but… results after stepping through (one replacement at a time), first attempt:

      this
      ?Cos I am
      that
      
      this
      -?-ound and-?-ound
      that
      

      Second attempt:

      this
      -?-os I am
      that
      
      this
      ?Round and-?-ound
      that
      

      Any idea what’s up with that?

      CoisesC 1 Reply Last reply Reply Quote 0
      • CoisesC Offline
        Coises @M Andre Z Eckenrode
        last edited by Coises

        @M-Andre-Z-Eckenrode said:

        Considering your explanation to me in the other thread, I’m assuming my utilization of the same regex via your plugin may have been doomed to failure anyway, but… results after stepping through (one replacement at a time), first attempt

        Those are strange results, which I can’t reproduce. Your find and replace combination works for all three occurrences on my installation.

        Looking at your debug info in the other thread, I see that you have a long list of plugins. I know this is a pain, but would you try:

        • Download a fresh, portable copy of Notepad++ (v8.9.7, 32 bit as per your debug info) and unzip that to a folder.
        • Download Search++ (v06.3.1, 32 bit), unzip that to a folder and rename the folder Search++.
        • Move the Search++ folder into the plugins folder within the portable Notepad++ folder.
        • Double-click notepad++.exe in the portable Notepad++ folder.

        and try your test with that copy of Notepad++?

        That would at least tell us whether there is something about your system that is different than mine, or something about your plugins or your Notepad++ configuration that is different.

        M Andre Z EckenrodeM 1 Reply Last reply Reply Quote 0
        • M Andre Z EckenrodeM Online
          M Andre Z Eckenrode @Coises
          last edited by

          @Coises said:

          I know this is a pain, but would you try:

          In the process of attempting to follow your instructions, I suffered a handful of detrimental (though not catastrophic) NPP-related events. Am I supposed to be able to run the portable copy of NPP while the installed copy is also running? When I tried to open the portable, it just brought my installed copy window to the front, and didn’t open anything new. Then I tried closing the installed copy, but immediately got an error dialog. I was hoping to do a screenshot of it but somehow failed to (it may have been something about my session file having been corrupted, as there was no session restoration when I eventually re-opened my installed copy). Rather than hitting OK or whatever option it gave me in the dialog, I tried opening a new installed NPP instance via my AutoHotkey keyboard sequence so I could take some notes that hopefully wouldn’t be affected by whatever problems the first instance was having at that point, but I then immediately got another error dialog, this one specifically for Search++:

          A configuration file was found, but it does not contain valid JSON and will be ignored.
          

          I hit OK in that one. The new instance opened, and the first error dialog disappeared. I then went ahead and closed the second instance, which resulted in this Search++ dialog:

          A configuration file found at startup was ignored because this plugin could not use it.
          Do you want to save the current configuration settings? (If Yes, the old file will be overwritten.)
          

          I hit YES, and then also closed the first instance.

          I then finally got the portable copy to open, and tried my regex in it. It all worked.

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors