I am having trouble finding how to execute regular expressions in Windows Command Line. I would want to use regular expressions for a number of situations, but basically now all I want to do is open a file with regular expressions in its name.
Example: Start s.html works fine, but start *.html does not work. What is needed?
Thanks
good to know that windows cmd line supports regex... but your example looks like glob, not regex.... good luck. Is this really about regular expression? Looks more like a simple wildcard match...
Unlike many Unix shells, the Windows command line processor does not expand wildcards automatically. It is each program's responsibility to expand wildcards as it sees fit. Many programs simply don't support wildcards at all. In those cases you can always create a FOR loop to repeatedly issue the same command on a set of files specified by a wildcard.
e.g. for %f in (*.txt) do echo %f
will echo the names of all *.txt files in a directory.
use the help command to get more detailed help on any Windows command. i.e.
help for
As for regular expressions: other than findstr
, I don't know of any built-in Windows command which supports regular expressions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With