Page 1 of 1

filenames search with more specific inquire (full words)

Posted: 26 Jan 2012 14:10
by abc550
Is there any option to find (in any search mode) all files, which includes some full words?

E.g search inquire cow*girl* in standard search mode currently returns:
cow eats my girl.doc
and
cowS eat my girlfriend.txt
and
cowgirls songs.mp3

Is it possible to exclude all variants except the first one?

Thanks!

Re: filenames search with more specific inquire (full words)

Posted: 26 Jan 2012 14:22
by TheQwerty
Doesn't a standard search for "cow girl" with match Whole Words enabled achieve this?

Re: filenames search with more specific inquire (full words)

Posted: 27 Jan 2012 11:32
by abc550
TheQwerty wrote:Doesn't a standard search for "cow girl" with match Whole Words enabled achieve this?
It's not quite the same: standard search mode without wildcards disregards the order of the elements of a serch inquire. So the inquie "cow girl" with match Whole Words enabled will return e.g. girl eats a cow. But the order is important: I need to find only items which start with the word "cow".

Re: filenames search with more specific inquire (full words)

Posted: 27 Jan 2012 11:43
by admin
Some RegExp will do... let's hear what the experts have to say...

Re: filenames search with more specific inquire (full words)

Posted: 27 Jan 2012 12:06
by highend
A standard regex for this could look like:

\bcow\b.*\bgirl\b

Re: filenames search with more specific inquire (full words)

Posted: 28 Jan 2012 12:50
by abc550
highend wrote:A standard regex for this could look like:
\bcow\b.*\bgirl\b
Seems, that is just the same as the sample "cow girl" with match Whole Words enabled in standard mode (see previous posts in this topic). The both ignore the sequence of the words. This sample will find the both "cow eats a girl.txt" and "a girl eats a cow.txt".
Furthermore, it would be nice to have an option to find only those items, where the first word of the search query does match with the first word of the filename.

Re: filenames search with more specific inquire (full words)

Posted: 28 Jan 2012 13:21
by highend
Before I posted that regex I tried it...

These are the files in my testfolder:

Code: Select all

a cow eats a girl.txt
a girl eats a cow.txt
cow eats a girl.txt
cowgirls songs.mp3
cowS eat my girlfriend.txt
Regex:

Code: Select all

\bcow\b.*\bgirl\b
Finds 2 files:

Code: Select all

a cow eats a girl.txt
cow eats a girl.txt
"a girl eats a cow.txt" is NOT found...

And if you want to find these two words with cow at the beginning of the line use:

Code: Select all

^\bcow\b.*\bgirl\b
Used for the same 5 files, it will only find:

Code: Select all

cow eats a girl.txt
Afaik that's what you wanted...

Re: filenames search with more specific inquire (full words)

Posted: 28 Jan 2012 13:34
by abc550
highend wrote:Before I posted that regex I tried it...
Afaik that's what you wanted...
My apologies! I've tested your regexp with a wrong files set. Actually the both your regexps work exactly as I needed.
Many thanks!