[Suggestion] Add The library tab in the Find and Replace window to reuse Regexes mainly
-
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 theFind/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 theRegular exprresion
is not ticked, this choice forces theNormal
search mode, automatically. Note that I personally never use theExtended
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
andwhole word
boxes, what’s about the other options :-
Backward direction
-
Wrap around
-
. matches newline
-
Filters
anddirectories
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 sameResults.txt
file, to get the needed modifications !Best Regards,
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).
-
Hi, @michael-vincent, @peterjones, @alan-kilborn and All,
So Alan, if I follow your reasoning, it means that, rather than having the
3
zonesCase sensitive
,Whole word only
andRegular expression
, at the bottom of the window, we should better put the3
modes of searchNormal
,Extended
andRegExp
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
-
@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 :-)
-
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:
andDirectory:
fields ) -
Regarding the tracking of the search (
Bookmark line
andPurge 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
andNormal
-
Extended
,RegExp
andRegExp (Dot=All)
Just a suggestion, of course !
Best Regards,
guy038
-
-
@Taije Park a new feature is a new beginning. I really like your idea.
-
@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. -
Another recent feature request for this: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11981
-
-
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-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 threadhttps://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
-
@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.
-
@PeterJones Thanks. Yes I understand. But I didn’t find any button to upvote ISSUE in GitHub.
-
@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.
-
@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