I am really struggling trying to get a regex expression to work with findstr. I have the following in a text file called filelist.txt as an example….
test1
test12
test13
test14
uyt*
test16
test19
test47
nam;
help367
file1
named665
I also have a set of acceptable characters which are A-Z, a-z, 0-9, space ./-_
I want to run findstr and have it return all the results which contain characters that are not acceptable, in this case it should return the following….
**nam;
uyt***
I am using the following command
findstr /r /v "[^a-zA-Z0-9_./-]" filelist.txt
But this is returning the opposite of what I want, it is displaying all entries that don’t have special characters in them. I have tried substituting /v for /x to display the matches but this does not return anything.
Can anyone help???
Try:
or