• 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.2k 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.
  • T
    Taije Park
    last edited by May 18, 2022, 4:28 PM

    I would like to suggest to add the library tab next to the mark tab in the find and replace window.
    It should include title, explanation, save, load, options, etc.
    It wolud give a great convenience to the users of the NotePad++

    It would be like this for an example.
    We can save and reuse ‘Find what’, ‘Replace with’ and Options, especially with Regular expressions.
    I have long wanted this feature in the Find and Replace window.

    b48616b1-06d3-4079-8322-fbbff8b5a359-image.png

    funtions are described briefly as following in my thought.
    Add Button will make a new title and explanation.
    Update Button will update existing title, explanation.
    Del button will delete existing Title: Explanation when it is selected.
    Double click on Title1: Explanation1 will change ‘Find what’, ‘Replace with’ and Options contents.
    And it will change other tabs contents.

    Thank you

    P 1 Reply Last reply May 18, 2022, 5:05 PM Reply Quote 3
    • P
      PeterJones @Taije Park
      last edited by PeterJones May 18, 2022, 5:06 PM May 18, 2022, 5:05 PM

      @taije-park ,

      This forum is fellow users of Notepad++ – we cannot add features. We can only discuss whether we think it’s a good idea or not.

      You already created the official issue a week ago, and that is the one and only place where a decision could be made to implement it. If they don’t decide to implement it there, you could post it a billion times in this forum and other places, and it won’t change the fact that it won’t be implemented unless they decide to implement it in the GitHub issues area.

      If you had wanted to encourage people to upvote your issue, you should have at least provided a link to it. Since you didn’t provide that link, I can only assume that you got impatient with the official feature-request response after 5 days, and decided to come here instead, hoping that there was no overlap and no one would notice you were duplicating a previous discussion (it didn’t work, if that’s what you were trying).

      Also, it’s been requested multiple times – here and and in the official issues. I cannot find any of the recent ones, though I know it’s been talked about recently. But I did find this recent official feature request which is essentially the same: someone asking for a way to save their favorite search expressions long term.

      I found this older post from @Alan-Kilborn which shows a “poor man’s regex favorites” workaround, which you may or may not be willing to utilize in the absence of that feature request being implemented.

      (This is a really hard discussion or feature request, because everyone will use different terms to refer to the same thing: “pin favorites” or “save search expressions” or “bookmark regex” or … Doing a cohesive historical search on those is hard. Or maybe I’m just having a bad search day. I know this has been requested recently in the forum, and I am sure there are more open and maybe even closed official-feature-requests on that)

      1 Reply Last reply Reply Quote 0
      • A
        Alan Kilborn
        last edited by May 18, 2022, 5:47 PM

        The OP’s suggestion here in this thread (using a “Library” tab) seems a bit, well, bad for a UI. Especially one that is rather space-limited, like Notepad++'s. I don’t really like the Title/Explanation duality – couldn’t this be combined into one thing?

        I think I like the suggestion HERE for EditPlus the best; the UI from there shown below for convenience of reference:

        b3adbd14-f875-4fc8-b0ad-d7c4a295d65d-image.png

        It might be best to take that (the EditPlus example) a bit further and show a populated top list box. I don’t know EditPlus, but I would expect that double-clicking an entry in that top list box would cause the “Find & Replace List” window to close and the double-clicked entry’s parameters to be copied back into the original dialog that had the “List…” button?

        There are some additional hurdles for this when thinking about Notepad++ (presuming a “List…” button appears on every tab of the Find dialog tab control), but it wouldn’t be too bad…

        I think this might be a good start for a needed Notepad++ feature.

        (Of course, I don’t know UltraEdit either, and in the github issue the UltraEdit example wasn’t really shown, but maybe it has some design tidbits to offer as well).

        A P 2 Replies Last reply May 18, 2022, 6:53 PM Reply Quote 3
        • A
          Alan Kilborn @Alan Kilborn
          last edited by May 18, 2022, 6:53 PM

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

          …I would expect that double-clicking an entry in that top list box would cause the “Find & Replace List” window to close and the double-clicked entry’s parameters to be copied back into the original dialog that had the “List…” button?

          Of course, clicking OK after making a selection would do the same thing (forgot to say this originally).

          1 Reply Last reply Reply Quote 1
          • A
            Alan Kilborn
            last edited by May 18, 2022, 8:18 PM

            More thoughts:

            • Change EditPlus’s OK button to “Use” (this would also save any unsaved changes to the current entry before “using” it)
            • Change EditPlus’s Remove button to “Delete” (delete being a more-common Notepad++ usage) (this was actually OP’s idea); deletion would need to be confirmed
            • Change EditPlus’s Up and Down buttons to be more explicit as “Move Up” and “Move Down” to move the currently selected entry up or down
            • Add a “Duplicate” button to make a copy of the current entry (if there are unsaved changes to the current entry, save them before doing the duplication)
            • Add an “Update” button if the user starts making changes to the current entry’s data (this was actually OP’s idea) but doesn’t want to close the box and “use” the current entry, just wants to save it
            • To abort errant changes to the current entry, “Cancel” button would be used (have to re-press the “List…” button to come back in and do more editing)
            • When the “List…” button is pressed, if the current find/replace data is not in the list, offer to add it? If it is in the list, make it the current entry for quick-access mods?
            1 Reply Last reply Reply Quote 2
            • P
              PeterJones @Alan Kilborn
              last edited by PeterJones May 19, 2022, 3:14 PM May 19, 2022, 3:11 PM

              @alan-kilborn ,

              I’ll weigh in with my ℕ¢:

              • Having a Library… button that pops up a second window next to the Find window makes more sense to me than having a separate Library tab: I would think anyone who wanted a library of frequent expressions would want to be able to use them for Find, Replace, Find in Files/Projects or Mark, and that just wouldn’t work well with a Library tab, because you’d keep having to tab between the Library tab and the actual Find or Replace tab as you wanted to access the library.
              • I prefer the name Library… for that button instead of List…
              • I think Use makes more sense than OK for copying the selected expression to the Find/Replace window
              • I do not think that Use should close the Library window… I would want to keep that second dialog open while doing multiple searches or replacements (similar to the way that the Find window stays open to allow for Find Next or modifying the regex without closing the window)
              • I agree there should be an Update button – or maybe Modify, with no strong opinion as to which. (I originally thought I liked Modify more, but Update is growing on me)
              • I think the “exit the Library” button should be Close rather than Cancel: my reasoning would be that a user might think that Cancel would undo everything done in the Library window – so it would undo adds, deletes, moves, or uses. But I don’t think it’s practical to keep a history of all those events to be able to fully undo everything. One would have to hit Close before doing a Use if one doesn’t want to change the FIND/REPLACE expressions in the Find window; one would have to do a Close before doing an Update if one didn’t want to change the values in that entry in the library. But once Use or Modify or Add or Delete is clicked, I do not think it should be undoable, and Cancel would imply that to at least a large subset of users.
              • Definitely offer to add the existing FIND/REPLACE pair to the library when Library… is first opened… but rather than an extra popup for the “offer”, I would just say pre-populate the input fields in the library and make sure that Add is enabled with nothing in the main panel selected. Something like:
                fa2cad69-d5bf-462c-b927-72ac035cbe87-image.png
              M 1 Reply Last reply May 19, 2022, 5:40 PM Reply Quote 5
              • M
                Michael Vincent @PeterJones
                last edited by May 19, 2022, 5:40 PM

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

                @alan-kilborn ,
                I’ll weigh in with my ℕ¢:

                All great points! I think the separate GUI is key since the Find / Replace dialogue and each tab is already very busy - a button to open the new “Library” form consistent on each tab would do the trick along with all the recommendations you all make about the visual elements of that new GUI.

                Cheers.

                1 Reply Last reply Reply Quote 4
                • 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 :-)

                        Lycan ThropeL 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
                            • Lycan ThropeL
                              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
                                • P 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 P 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
                                    • P
                                      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.

                                        P 1 Reply Last reply Feb 27, 2023, 5:31 PM Reply Quote 0
                                        • P
                                          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
                                          • First post
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors