Regular expression to match text that doesn't start with substring?
- by Steven
I have text with file names scattered throughout. The filenames appear in the text like this:
|test.txt|
|usr01.txt|
|usr02.txt|
|foo.txt|
I want to match the filenames that don't start with usr. I came up with (?<=\|).*\.txt(?=\|) to match the filenames, but it doesn't exclude the ones starting with usr. Is this possible with regular expressions?