Add Underscore to "Whole Word" Separator Characters

Have a suggestion for "Everything"? Please post it here.
Post Reply
mwsm
Posts: 21
Joined: Thu Feb 28, 2013 2:01 am

Add Underscore to "Whole Word" Separator Characters

Post by mwsm »

Would it be possible to add the underscore ("_") to the word separator characters in the Match Whole Word feature (and wholeword: modifier)? The underscore is a common word separator in source code file names, so this would be very handy for searching.

Even better would be an .ini option to add an arbitrary list of separator characters.
therube
Posts: 5056
Joined: Thu Sep 03, 2009 6:48 pm

Re: Add Underscore to "Whole Word" Separator Characters

Post by therube »

Can't you just type the _ & the following wanted word?

00-crazy_frog-stupid_animal-2005.m3u
03-crazy_frog-popcorn.mp3

Finds something:
file: ww:crazy
file: ww:crazy_frog
file: ww:crazy_frog-
file: ww:crazy_frog-popcorn

Does not find anything:
file: ww:crazy_ <finds nothing
file: ww:crazy_frog-s < finds nothing
mwsm
Posts: 21
Joined: Thu Feb 28, 2013 2:01 am

Re: Add Underscore to "Whole Word" Separator Characters

Post by mwsm »

You could do that, if you were searching for a specific file and knew the details of the file name. However if you were searching across multiple hard-drives and thousands of files, and wanted to find all occurrences of eg " frog ", "frog,", "_frog_", etc, but not "frogs", then wholeword: would miss the "_frog_" files because of the underscores. Note that "ww:crazy" would not return either of your example files.

It's possible to use a regular expression to accomplish this, eg "regex:[^a-z]frog[^a-z]", but I do searches like this all the time and it would be very handy to have "_" included in wholeword:, at least as an option.
therube
Posts: 5056
Joined: Thu Sep 03, 2009 6:48 pm

Re: Add Underscore to "Whole Word" Separator Characters

Post by therube »

Note that "ww:crazy" would not return either of your example files.
Ah, you're right again. I must have had Match Path set at the time.
therube
Posts: 5056
Joined: Thu Sep 03, 2009 6:48 pm

Re: Add Underscore to "Whole Word" Separator Characters

Post by therube »

Somewhat related, Filter: ignore.
void
Developer
Posts: 17155
Joined: Fri Oct 16, 2009 11:31 pm

Re: Add Underscore to "Whole Word" Separator Characters

Post by void »

Treating _ as part of the word makes sense for programming languages, not so much filenames.

I'll consider treating _ as a word break.

Thanks for the suggestion.
Post Reply