In a text containing lines with full paths, I need to match only lines whose file name doesn't start with the word 'TMP' (case insensitive).
In the next sample list, lines marked with "EXCLUDE" shouldn't be matched.
c:\folder1\TMP_file.ext----------EXCLUDE
c:\TMP_folder1\file.ext
c:\folder1\TMP_folder2\file.ext
c:\folder1/TMP_file.ext----------EXCLUDE
c:\file.ext
c:\TMP_file.ext------------------EXCLUDE
TMP_file.ext---------------------EXCLUDE
file.ext
I came up with the simple expression [^\\/\r\n]+$
(accepting '\' and '/' as directory separators) that successfully matches whole file names with their extensions, but I can't figure out how to add (?!...)
to exclude the matches that start with 'tmp'.
Inverting the expression tmp[^\\/\r\n]+$
would be also the solution, but I don't know how.
I know this question is similar to others (taking the risk of a downvote...) but I didn't found a way to connect them with this problem.