我需要检查传递给Windows批处理文件的参数是否为数字.
我发现下面的答案是使用带有正则表达式的"findstr"命令:https: //superuser.com/questions/404338/check-for-only-numerical-input-in-batch-file
我确实尝试过这个解决方案,但它没有用.(至少在Windows 7中不起作用).
测试场景:
AA #NOT A VALID NUMBER
A1 #NOT A VALID NUMBER
1A #NOT A VALID NUMBER
11 #A VALID NUMBER
Run Code Online (Sandbox Code Playgroud) batch-file ×1