While writing some recent scripts in cmd.exe, I had a need to use findstr
with regular expressions - customer required standard cmd.exe commands (no GnuWin32 no
Everyone above is wrong.
The alpha chars order is the follwoing: aAbBcCdDeE..zZ
so echo a | findstr /r "[A-Z]"
returns nothing, since a
is outside of that range.
echo abc|findstr /r "[A-Z][A-Z][A-Z]"
also returns nothing, since first range group matches b
, second one matches c
and the third one matches nothing and thus the whole regex pattern finds nothing.
If you like to match any character of latin alphabet - use [a-Z]
.