Try to search your question here, if you can't find : Ask Any Question Now ?

Use findstr regular expressions to search for patterns in piped results

HomeCategory: stackoverflowUse findstr regular expressions to search for patterns in piped results
Avatarbhawya asked 4 months ago

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[123456789][0123456789]*" is a safer option.

1 Answers
Best Answer
AvatarJyoti answered 4 months ago
Your Answer

15 + 20 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com