0 votes

In "File name" field, I have this regular expression: .[^log].\.txt

On my monitor, the pattern above does not show the asterix in the question. The pattern is:
'dot' + 'asterix' + '[^log]' + 'dot' + 'asterix' + 'backslash' + 'dot' + 'txt'

I'm searching for text in filename that do not contain the word 'log'. Example of filename:

Report[12345]_002logB.txt
Report[12345]_002.txt   -----> this is the file I want to search text into

etc.

The text I'm searching for is in both files, but I'm only interested in the file that does not contain 'log' in its name. However, the search results gives me both files.

In real searches, I have hundreds of file (not just the 2 examples above).

Thanks

by (40 points)

1 Answer

0 votes

I think you've misunderstood the negated character class. The regex

[^log]

translates as 'any character except L, O, or G'

You're probably better off with a DOS expression:

*.txt;NOT:log
by (29.5k points)
...