Jef*_*eff 5 regex string powershell
我需要检查一个字符串,看它是否包含空格,返回等以外的任何内容.
在perl中,我用过:
if($val =~/^\s*$/) {...}
Run Code Online (Sandbox Code Playgroud)
我如何在PowerShell中执行此操作?
And*_*ndi 11
使用-match运营商:
if ($test -match 'regex_here') { 'It matched' }
Run Code Online (Sandbox Code Playgroud)
另请查看在线文档以获取比较运算符:http://technet.microsoft.com/en-us/library/hh847759.aspx