I want to search for the pattern
(COMd+) in the output of
mode command. I have tried the:
mode | findstr /R (COMd+)
But it doesn’t return anything. I would appreciate if you could help me know what is the correct way to do this.
P.S.1 Thanks to the comments I now have the
mode | findstr /RC:"COM[0-9*]" which yields the line with the given match. Now I need to find a way to print out just the match. maybe using the
for /f ... in to loop the string?
P.S.2 I’m being told that
mode | findstr /RC:"COM*" is a safer option.