Community
    • Login

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

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    22 Posts 4 Posters 558 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 Offline
      M Andre Z Eckenrode @Coises
      last edited by

      @Coises said:

      I didn’t think to mention that quirk. If you start with a rectangular selection, Columns++ searches each row independently

      Aha. That explains my own confusion. That was actually the first time I’d used the Search feature of Columns++. For the record, any time I’m doing regex search & replace in NPP that either turns out to be more complicated than I expected, or involves some trial and error, or which I’m going to want to utilize again elsewhere (such as this topic), I’m in the habit of typing it out right in the text document I’m working on, and then I select/copy the replacement regex, then select the find regex and open the necessary dialog, expecting the Find what to have been automatically populated from my most recent selection (which, of course, didn’t happen in that case). It didn’t occur to me that that wouldn’t work in Columns++. So, when I opened Columns++’s Search dialog with only the content of one line selected and tried to perform my regex search, it threw this at me:

      This command requires a rectangular selection. Extend selection to the last line of the document?
      

      And, Columns++ Search neophyte that I am, I didn’t heed the suggestion. I closed the dialog and created a rectangular selection.

      Now that I’ve been made aware of the error of my ways, I’ve redone the experiment with all the my example text selected, and all instances of ' were successfully replaced with ’, without any anomalies.

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

        @M-Andre-Z-Eckenrode said:

        This command requires a rectangular selection. Extend selection to the last line of the document?
        

        And, Columns++ Search neophyte that I am, I didn’t heed the suggestion.

        Had you heeded it, you would still have gotten a rectangular selection, as it says, extending downward from your selection — not necessarily enclosing the whole document, and in any case not the same as selecting the whole document (or selecting nothing at all) first.

        I should re-word that message, I’m just not sure what to say instead. It’s not actually true (since version 0.8) that a rectangular selection is required; as I mentioned before, the rules are complicated. They won’t easily fit into a message box. It makes sense when you’re using Columns++ for working with columns, but the search kind of took on a life of its own, apart from column work… hence, among other reasons, Search++.

        I’ve redone the experiment with all the my example text selected, and all instances of ' were successfully replaced with ’, without any anomalies.

        Thank you for that information. I do appreciate the help you’ve given me with this. While it doesn’t prove anything (almost nothing is ever proven when dealing with an intermittent bug), it suggests pretty strongly that something I changed in moving the Columns++ search process to Search++ has introduced a hidden instability. I’m still looking for it.

        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