I need a way to match file names in a directory.
For example, I have three files:
CAt_DoG_ZebRa.TXT MOUSE_lion_deer_BIRD.TXT fIsh_biRD_LION.TXT
I am not a regular expression expert in any way, however I used to use something similar in SnapLogic and Pentaho before:
(?i).*(?=.*bird)(?=.*lion).*.TXT
The above will correspond to all file names that contain the words βbirdβ and βlionβ, the case being ignored and the word order does not matter. Very powerful! Thus, this will correspond to these two:
MOUSE_lion_deer_BIRD.TXT fIsh_biRD_LION.TXT
I tried many options above in combination with find and grep, but to no avail. For instance:
find . -regex ".*/(?i).*(?=.*bird)(?=.*lion).*.TXT"
The above find does not match anything.
Can someone recommend a way to do this?
source share