The “findstr” Command and Regex in DOS

Recorded on December 15th, 2016

I learned another cool DOS command line trick today. You can use the findstr command to match regex patterns in the output coming from the dir command. Here’s an example from Stack Overflow:

What does the DOS command “findstr” do here? - Stack Overflow

You use the command like this, putting whatever your match string is in quotes:

dir | findstr "test[0-9][0-9][0-9]test"
blog comments powered by Disqus