Well, now this expression is a bit too complex for everyday using, don't you think so?jacky wrote:...if it is only a list of words that must all be present in the filenames, then maybe this would work for you :This regexp sould match all filenames that contains the words "dog" and "food" and "cat*" (so cat, cats or category but not advocate)Code: Select all
>^(?=.*?\bdog\b)(?=.*?\bfood\b)(?=.*?\bcat).*$
However could you please explain the syntax of it? I can recognize only the beginning and the end of line and .* (anykey with iterator), but not those subexpressions inside brackets
And... are you sure, that regular expressions are not sensitive to the order of words? I'm afraid your expression will return only "Dog and food for cats.txt" (the same order of words as in the inquire), but not "Food and cats for a dog.txt".