Powershell 通配符用于编写 Powershell 脚本



.ps1(powershell脚本)文件中的以下表达式是什么意思?

$row=".+\(.+.exe)";

据我了解,"\"用于转义,并使进行字符从字面上理解。但我对这里"."的用法感到困惑。有人可以帮助我吗?

这看起来像是匹配文件路径的正则表达式的一部分。分解此正则表达式:

.+        matches one or more characters (of anything)
\        matches the '' character (needs the  to escape the  character)
(    
   .+     matches one or more characters (of anything)
   .     matches the '.' character (needs the  to escape the . character)
   exe    matches exe
)

. 是一个特殊字符,表示匹配任何字符。

最新更新