0

.ps1 (powershell スクリプト) ファイル内の次の式は何を意味していますか?

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

私が理解していることから、「\」はエスケープに使用され、先行する文字が文字通り取られます。しかし、「。」の使い方に混​​乱しています。ここ。誰かがこれで私を助けることができますか?

4

1 に答える 1

2

これは、ファイル パスに一致する正規表現の一部のようです。この正規表現を分解します。

.+        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
)

。任意の文字に一致することを意味する特殊文字です。

于 2012-04-18T22:59:58.120 に答える