Using FINDSTR to locate a string using regex

28 views Asked by At

Hello I am trying to match lines in a text file using this:

findstr /i "6.0.0.0.[0-9][0-9][0-9][0-9] Wave Embedded 6.0 ([0-9][0-9][0-9][0-9])" C:\IOManifest.txt 

but all it does is open up the file at C:\IOManifest.txt and print it to screen...

a correct match would be "6.0.0.0.3456 Wave Embedded 6.0 (3957)

what am i doing wrong?

1

There are 1 answers

1
Marichyasana On

This works:

echo 6.0.0.0.3456 Wave Embedded 6.0 (3957) | findstr /i "6.0.0.0.[0-9][0-9][0-9][0-9] Wave Embedded 6.0 ([0-9][0-9][0-9][0-9])"  

So you should use:

type C:\IOManifest.txt | findstr /i "6.0.0.0.[0-9][0-9][0-9][0-9] Wave Embedded 6.0 ([0-9][0-9][0-9][0-9])"