• Login
Community
  • Login

[Suggestion] Add The library tab in the Find and Replace window to reuse Regexes mainly

Scheduled Pinned Locked Moved General Discussion
feature request
21 Posts 8 Posters 2.4k 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.
  • G
    guy038
    last edited by guy038 May 19, 2022, 8:50 PM May 19, 2022, 8:40 PM

    Hello, @michael-vincent, @peterjones, @alan-kilborn and All,

    Peter, I agree to that @michael-vincent said :

    All great points! I think the separate GUI is key


    Now, Michael, you said :

    a button to open the new “Library” form consistent on each tab would do the trick…

    Huuum, I would say that opening this new window with the Library button should recapitulate all the parameters, regarding the Find/Replace/Mark feature. Indeed, for instance :

    • You may decide to extend a search, initially done on all opened documents, to some directories, and, possibly, update the library, accordingly

    • You may decide to extend a simple search, already saved, to a search and replace action and add this new S/R to the library

    In the opposite way :

    • You may decide to modify an initial search and replace saved operation to a simple Mark operation, and so on…

    Some specific points :

    • What’s about the Extended (\n, \r, \t, \0, \x..) search mode ? From your pictures, if the Regular exprresion is not ticked, this choice forces the Normal search mode, automatically. Note that I personally never use the Extended mode but some people may be used to select it !

    • If we suppose that each item of the library will save the states of the case and whole word boxes, what’s about the other options :

      • Backward direction

      • Wrap around

      • . matches newline

      • Filters and directories fields :

      • Bookmark line

      • Purge for each search

    To my mind, their states should be saved, too as it determines the way the global action is performed !


    Now, I’m thinking about a small improvement. Let’s imagine, in the main panel of the new Find and Replace Library, something like that :

    # My SPECIFIC changes in the 'Results.txt' file, exported from the 'Everything' software :
    
        - Change the HEADER line
        - Modify the column's ORDER and the SEPARATORS 
        - Justify the SIZE numbers to the RIGHT
    

    Corresponding, in my case, to the following `S/R`` :

    SEARCH    "Nom","Chemin","Taille","Extension","Date de modification","Type","Date de création","Horodatage dernier accès","Attributs","Date d'exécution"
    
    REPLACE   "Nom","Chemin",123456789,"Extension",2021-12-31 23:59:59,"Type",2021-12-31 23:59:59,2021-12-31 23:59:59,"Attributs",2021-12-31 23:59:59
    
    
    SEARCH    (?-s)^"(.+?)","(.+?)",(\d+),".+?",(.+?),.+
    
    REPLACE   \1\t\3\t\4\t\2
    
    
    SEARCH    \x20{5}\K(\d+)(\x20+)(?=\x20{5}\d{4}-\d\d-\d\d)
    
    REPLACE   \2\1
    

    Of course , I do not mean at all that these 3 S/R should be executed in one go !

    I just mean, that, from my comment header, beginning with a # char, the indented items show a group of several independent S/R, which must be sequentially executed against the same Results.txt file, to get the needed modifications !

    Best Regards,

    guy038

    1 Reply Last reply Reply Quote 2
    • A
      Alan Kilborn
      last edited by May 19, 2022, 9:17 PM

      @guy038

      opening this new window with the Library button should recapitulate all the parameters, regarding the Find/Replace/Mark feature

      I think the intent here is not really to reinvent currently macro-recordable complete actions (Find/Replace/Find in Files/Mark) but rather just to capture the “searchable” part. Thus, something that is part of the “Library” can be used independently of the specific search function. Now, clearly a bit of replace text is only good for a replace (or replace-in-files) action, and so remains unspecified for other types of actions, but things like directory/bookmark/filters/search-direction/etc. (things that don’t impact the direct text search) are not important. I’m not sure how to best say it, but perhaps you get my meaning. If this feature gets over-complicated in its specification, it won’t possibly get implemented.

      What’s about the Extended (\n, \r, \t, \0, \x…) search mode ?

      Surely an oversight in previous discussions; it should be included. And maybe also worth saying is that “whole word” should be disabled when “regular expression” is selected on an entry.

      I’m thinking about a small improvement…

      This could be handled by no additional logic/code, but rather by a common prefix on the "Description"s of several sequential entries (can be made sequential with the “Move Up”/“Move Down” buttons if needed).

      1 Reply Last reply Reply Quote 2
      • G
        guy038
        last edited by guy038 May 19, 2022, 11:29 PM May 19, 2022, 11:23 PM

        Hi, @michael-vincent, @peterjones, @alan-kilborn and All,

        So Alan, if I follow your reasoning, it means that, rather than having the 3 zones Case sensitive, Whole word only and Regular expression, at the bottom of the window, we should better put the 3 modes of search Normal, Extended and RegExp

        Then, it would be up to each user to verify the state of the different checkboxes and fields, before starting the whole process. Indeed, they could be considered as flavours of the chosen search mode !

        BR

        guy038

        A 1 Reply Last reply May 20, 2022, 1:29 AM Reply Quote 2
        • A
          Alan Kilborn @guy038
          last edited by May 20, 2022, 1:29 AM

          @guy038 said in [Suggestion] Add The library tab in the Find and Replace window to reuse Regexes mainly:

          it means that, rather than having the 3 zones Case sensitive, Whole word only and Regular expression, at the bottom of the window, we should better put the 3 modes of search Normal, Extended and RegExp

          Well…I think the following all belong:

          • case sensitive checkbox
          • whole word checkbox
          • search mode dropdown with the obvious 3 choices: Normal, Extended, Regular expression – or maybe 4 choices: Normal, Extended, Regular expression where . matches newline, Regular expression where . doesn’t match newline.

          Surely you see that e.g. “case sensitive” is more bound into the search trying to be captured here than something like e.g. “Backward direction”.

          BTW, and I probably should have stated this earlier, a design goal with crafting a specification for this is that we don’t go this far with it: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9627 :-)

          L 1 Reply Last reply Jun 11, 2022, 8:46 PM Reply Quote 2
          • G
            guy038
            last edited by guy038 Oct 23, 2022, 11:43 AM May 20, 2022, 9:28 AM

            Hi, @alan-kilborn and All,

            Yes, your proposition seems sensible ! In this new Find and Replace Library window, we should stay concerned about options relative to the WAY of searching and/or replacing.

            And all the other parameters :

            • Regarding the direction of the search ( Backward direction, Wrap around options )

            • Regarding the scope of the search ( Filters: and Directory: fields )

            • Regarding the tracking of the search ( Bookmark line and Purge for each search options )

            would be defined by the user, before running the process


            Thus, this leads to have, at the bottom of that window, two rows of options :

            • Case sensitive, Whole word and Normal

            • Extended, RegExp and RegExp (Dot=All)

            Just a suggestion, of course !

            Best Regards,

            guy038

            Robin CruiseR 1 Reply Last reply Jun 11, 2022, 8:32 PM Reply Quote 4
            • Robin CruiseR
              Robin Cruise @guy038
              last edited by Jun 11, 2022, 8:32 PM

              @Taije Park a new feature is a new beginning. I really like your idea.

              1 Reply Last reply Reply Quote 0
              • L
                Lycan Thrope @Alan Kilborn
                last edited by Lycan Thrope Jun 11, 2022, 8:46 PM Jun 11, 2022, 8:46 PM

                @alan-kilborn ,
                After looking at that, I agree, that is a micro management screen. :)
                All people really want is something to store their regularly used search expressions in a handy library space with the search and replace menu so it pastes it in and runs it. Anything more than that can overwhelm users, especially novices…which seems to be the dominant species to using the free Notepad++ editor.

                A 1 Reply Last reply Aug 5, 2022, 12:24 PM Reply Quote 0
                • A
                  Alan Kilborn @Lycan Thrope
                  last edited by Aug 5, 2022, 12:24 PM

                  Another recent feature request for this: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11981

                  1 Reply Last reply Reply Quote 1
                  • PeterJonesP PeterJones referenced this topic on Sep 13, 2022, 5:41 PM
                  • Remote RVR
                    Remote RV
                    last edited by Remote RV Feb 27, 2023, 11:29 AM Feb 27, 2023, 11:24 AM

                    I was just about to post this exact same Feature Request…

                    I believe that whenever you have RegEx options in Search and Replace, there should be an option to save the Searches…

                    Constructing RegEx is pain. No one wants to go thought that repeatedly unless necessary :)

                    Also naming the saved searches is critical because without the name you only have the regex string visible and you must still DECIPHER weeks later what does it do… an explanatory name of the bookmark/preset is crucial for quick and confident re-use

                    example of self-explanatory saved searches presets

                    “Replace department codes in HR Quarterly Report”
                    “Book Reviews - Add TAB after Chapter Numbers”
                    “AD Data Export - Delete employee number”

                    This request will no doubt keep re-appearing in new GitHub requests and Notepad Community topics…

                    There are MANY text editors out there that already have this so when i first moved to NP++ it was sad to find out this is missing… still I like NP++ very much but sometimes I keep another editor handy with the search bookmarks for those regular regex operations…

                    Also please anyone who like this… UPVOTE the original message (Taije Park 18. May 2022 6:28 PM)… so the upvotes are visible in the forum…

                    Remote RVR PeterJonesP 2 Replies Last reply Feb 27, 2023, 12:09 PM Reply Quote 0
                    • Remote RVR
                      Remote RV @Remote RV
                      last edited by Remote RV Feb 27, 2023, 12:13 PM Feb 27, 2023, 12:09 PM

                      @Remote-RV This is all the GitHub Feature Requests asking for the same thing (ability to save Search/Replace presets)

                      https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11669
                      this is the request from Taije Park linking to this Notepad community thread

                      https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11309

                      https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4700

                      https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11981

                      https://github.com/notepad-plus-plus/notepad-plus-plus/issues/5823

                      1 Reply Last reply Reply Quote 0
                      • PeterJonesP
                        PeterJones @Remote RV
                        last edited by Feb 27, 2023, 2:14 PM

                        @Remote-RV said in [Suggestion] Add The library tab in the Find and Replace window to reuse Regexes mainly:

                        Also please anyone who like this… UPVOTE the original message (Taije Park 18. May 2022 6:28 PM)… so the upvotes are visible in the forum…

                        I have no problem with encouraging people to upvote certain posts in the forum. But in case there is any confusion on your part or the part of those who read your post: it won’t change anything. What happens here is virtually irrelevant to the decision maker in the github repository. The developer does not hang out in the forum, and he doesn’t look at upvotes on posts here to influence what gets implemented in Notepad++. If you really want to influence things, upvote and comment on the issues in the github repository – because he at least reads new issues, and might notice things like upvotes on a github request.

                        Remote RVR 1 Reply Last reply Feb 27, 2023, 5:25 PM Reply Quote 1
                        • Remote RVR
                          Remote RV @PeterJones
                          last edited by Feb 27, 2023, 5:25 PM

                          @PeterJones Thanks. Yes I understand. But I didn’t find any button to upvote ISSUE in GitHub.

                          PeterJonesP 1 Reply Last reply Feb 27, 2023, 5:31 PM Reply Quote 0
                          • PeterJonesP
                            PeterJones @Remote RV
                            last edited by Feb 27, 2023, 5:31 PM

                            @Remote-RV said in [Suggestion] Add The library tab in the Find and Replace window to reuse Regexes mainly:

                            I didn’t find any button to upvote ISSUE in GitHub.

                            335c15cd-8290-43c8-8c67-0fc8cb94a7f1-image.png

                            Remote RVR 1 Reply Last reply Feb 28, 2023, 9:21 AM Reply Quote 2
                            • Remote RVR
                              Remote RV @PeterJones
                              last edited by Feb 28, 2023, 9:21 AM

                              @PeterJones Aaaaah ok. I thought this is more of a reaction to individual post. I was wondering if there is like a voting mechanism on the issues as a whole that shows the developers which issues are “most wanted” in the grand scheme of 1900 opened issues… well I guess in the end developers do not decide based on votes anyway… its not that simple :)

                              but good to know there is THUMB UP

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