1
它是比較$ STRING1至特定字符串的模板在PowerShell中比較正則表達式字符串與
PS C:\ $string1 = '\\<a href="main\\.php\\?act=forum\\&hdl=read_\\&id=(\d+)\\&pid=313" class="small_name2"\\>Learn the powershell tool\\</a\\>'
PS C:\ $string1 -match '<a href="main.php?act=forum&hdl=read_&id=83523&pid=313" class="small_name2">Learn the powershell tool</a>'
False
什麼是錯的模板需要在PowerShell中的特殊字符及以上也許字符串? 謝謝!
可能要提'[正則表達式] ::逃亡()':) – briantist
'[正則表達式] ::逃亡()'會有幫助,但由於表達式包含一個組((\ d +)),因此在它之前和之後的子字符串必須單獨轉義,例如像這樣:'[正則表達式] :: Escape('')' –
啊,我現在看到,很好的捕獲。 – briantist