Search for various items in filenames

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, xnview

Post Reply
Subjektiv
Posts: 11
Joined: Fri Feb 12, 2010 10:41 am

Search for various items in filenames

Post by Subjektiv » Mon Sep 10, 2018 2:09 am

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!

User avatar
xnview
Author of XnView
Posts: 31891
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Search for various items in filenames

Post by xnview » Mon Sep 10, 2018 10:12 am

you need to use 'regex'
Pierre.

Subjektiv
Posts: 11
Joined: Fri Feb 12, 2010 10:41 am

Re: Search for various items in filenames

Post by Subjektiv » Tue Sep 11, 2018 7:55 am

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!

User avatar
michel038
Posts: 370
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Search for various items in filenames

Post by michel038 » Mon Oct 01, 2018 3:00 pm

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
Last edited by michel038 on Mon Oct 01, 2018 6:28 pm, edited 4 times in total.

User avatar
michel038
Posts: 370
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Search for various items in filenames

Post by michel038 » 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

cday
XnThusiast
Posts: 2190
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Search for various items in filenames

Post by cday » Mon Oct 01, 2018 3:57 pm

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?

User avatar
michel038
Posts: 370
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Search for various items in filenames

Post by michel038 » Mon Oct 01, 2018 5:04 pm

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

Post Reply