Multi Commander > Support and Feedback

File find

(1/2) > >>

amenu:
I just started using MC and am learning as I go along. I wanted to use file find to find filenames that had both of two words in them -- i.e., word1 and word2, not word1 or word2. I looked in the online documentation but did not see the answer. Where can I find this information.
-- Arthur

Jungle:
Probably you should use RegEx like

--- Code: ---(.*)(word1)(.*)(word2)(.*)
--- End code ---
to search for word1 followed by word2

or

--- Code: ---(.*)(word1|word2)(.*)(word2|word1)(.*)
--- End code ---
to ignore order

amenu:
I am not familiar with RegEx codes. Where is there an instruction manual where I can learn how to use RegEx?
-- Arthur

Jungle:
Basic info coud be found here

amenu:
I've looked at the Wikipedia article and have a sense of how RegEx works. Would not the second expression you gave:

Code:
(.*)(word1|word2)(.*)(word2|word1)(.*)

select the files I am looking for (files that have both word1 and word2 in any order in their filenames) but also select files with two occurrences of word1 and no occurrences of word2, or two occurrences of word2 and no occurrences of word1?

I am thinking ((.*)(word1)(.*)(word2)(.*))|((.*)(word2)(.*)(word1)(.*)) would give me just those files that have both word1 and word2 in any order in their filenames.

I am ready to be corrected, as I am obviously unschooled in RegEx.
-- Arthur

Navigation

[0] Message Index

[#] Next page

Go to full version