Search file path with multiple keywords

Hi Guys,

I am trying to get the pathname of files which contains specific keyword “exe” or “txt” or etc.
I can get the result if I parse single keyword “exe”, but I have around 20 keywords to search.
Here is the relevance im using.

Q: (pathnames of it as string) of (descendants whose (pathname of it as lowercase contains (“exe”;“txt”) ) of folders "" of drives)
E: A singular expression is required.

You can take a look at this post: File type search

Please note that searching through a lot of folders like this can be very costly and should not really be done in relevance within fixlets/tasks/baselines/analyses. If you are just looking for a quick relevance statement to troubleshoot something in the relevancedebugger you can use something like:

pathnames whose (exists match (regex "(\.exe$)|(\.txt$)" ) of it) of descendants of root folders of drives

But again, it’s not recommended to use this within the platform at all. Better approaches are outlined in the link above.
(Note: the statement above takes over a minute to evaluate in my relevance debugger -> it would take the client 50 times longer)

2 Likes

Thanks Marjan for your quick response.
This helped me exactly what I needed.
Fetching txt and exe files are just examples, I am looking for others files which might not even reside in my environment.

So thanks alot.

Regards,
Manoj Thathera

@Marjan,
Can you help me with the case insensitive, It returns only lowercase matches.
I tried something

pathnames whose (exists match (regex “(.exe$)|(.txt$)” ) of it as lowercase) of descendants of root folders of drives

But its not giving desired output.

I got the solution for this.

pathnames whose (exists match (case insensitive regex “(.exe$)|(.txt$)” ) of it as lowercase) of descendants of root folders of drives