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!
filenames search with more specific inquire (full words)
-
abc550
- Posts: 38
- Joined: 18 Feb 2010 09:46
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: filenames search with more specific inquire (full words)
Doesn't a standard search for "cow girl" with match Whole Words enabled achieve this?
-
abc550
- Posts: 38
- Joined: 18 Feb 2010 09:46
Re: filenames search with more specific inquire (full words)
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".TheQwerty wrote:Doesn't a standard search for "cow girl" with match Whole Words enabled achieve this?
-
admin
- Site Admin
- Posts: 66366
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: filenames search with more specific inquire (full words)
Some RegExp will do... let's hear what the experts have to say...
FAQ | XY News RSS | XY X
-
highend
- Posts: 14955
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: filenames search with more specific inquire (full words)
A standard regex for this could look like:
\bcow\b.*\bgirl\b
\bcow\b.*\bgirl\b
One of my scripts helped you out? Please donate via Paypal
-
abc550
- Posts: 38
- Joined: 18 Feb 2010 09:46
Re: filenames search with more specific inquire (full words)
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".highend wrote:A standard regex for this could look like:
\bcow\b.*\bgirl\b
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.
-
highend
- Posts: 14955
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: filenames search with more specific inquire (full words)
Before I posted that regex I tried it...
These are the files in my testfolder:
Regex:
Finds 2 files:
"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:
Used for the same 5 files, it will only find:
Afaik that's what you wanted...
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
Code: Select all
\bcow\b.*\bgirl\bCode: Select all
a cow eats a girl.txt
cow eats a girl.txt
And if you want to find these two words with cow at the beginning of the line use:
Code: Select all
^\bcow\b.*\bgirl\bCode: Select all
cow eats a girl.txtOne of my scripts helped you out? Please donate via Paypal
-
abc550
- Posts: 38
- Joined: 18 Feb 2010 09:46
Re: filenames search with more specific inquire (full words)
My apologies! I've tested your regexp with a wrong files set. Actually the both your regexps work exactly as I needed.highend wrote:Before I posted that regex I tried it...
Afaik that's what you wanted...
Many thanks!
XYplorer Beta Club