Page 1 of 1

Search for various items in filenames

Posted: Mon Sep 10, 2018 2:09 am
by Subjektiv
Hi!
Sorry, I am unable to search for filenames with various items.
For example: I want to find all files containig "mother" AND "father".
Is there any solution yet?

Thank You!

Re: Search for various items in filenames

Posted: Mon Sep 10, 2018 10:12 am
by xnview
you need to use 'regex'

Re: Search for various items in filenames

Posted: Tue Sep 11, 2018 7:55 am
by Subjektiv
Pierre, thank You for Your answer!

This problem was discussed here several times, and I have read some of Your advices in the past, but they all do not work.
There is no simple way to do "AND" searches with regexp, contrary to "Or" searches which are easy with "|" between the search terms. But nothing similar for "AND".
Maybe You eventually will find time to implement such a type of filesearch. Not only Users like me with about 50.000 pics would be very grateful.

Thanks in advance an best regards!

Re: Search for various items in filenames

Posted: Mon Oct 01, 2018 3:00 pm
by michel038
If it's not possible to find a "and" operator in regex, a workaround for developper could be to add "filename" field in "add conditions" items.

So we'll be able to create conditions like :

- match all of the following conditions (enable)
- filename contains father
- filename contains mother

directory or folder name fields are also welcome

Re: Search for various items in filenames

Posted: Mon Oct 01, 2018 3:43 pm
by michel038
With regex, two searches must be proceeded

mother.*father
father.*mother

The first one looks for names containing mother and father
The second one looks for father and mother

Re: Search for various items in filenames

Posted: Mon Oct 01, 2018 3:57 pm
by cday
michel038 wrote: Mon Oct 01, 2018 3:43 pm With regex, two searches must be proceeded

mother.*father
father.*mother

The first one looks for names containing mother and father
The second one looks for father and mother
Separate searches for 'mother followed by father' and 'father followed by mother' -- the sequence of the specified search terms matters?

Re: Search for various items in filenames

Posted: Mon Oct 01, 2018 5:04 pm
by michel038
Yes, i think

Code: Select all

mother.*father
means : string mother string father string
where "string" can be an empty string

I learnt this here : https://en.wikipedia.org/wiki/Regular_expression