"c:\ttc\ttc\OOO\UU" -match "[a-zA-Z]:\\((?'PTH'[^\/:\*?`"<>|]*)+(?'-PTH'\\)+)*(?(Open)(?!))()" ; $Matches
"mmmnnn" -match "(?<orz>mmm)(?(orz)1+|nnn)"; $Matches
"mmmnnn" -match "(?<orz>mmm)(?(orz)nnn|1+)"; $Matches
"aab" -match "^(?=aa)aaa"
#False "aab" -match "^(?=aa)aab" #True "abc" -match "^(?=ab)abc$"
#True "abc" -match "^(?=abc)abc$" #True "abc" -match "(?=abc)abc$" #True "abc" -match "a(?=bc)bc$"
#True
"123ABC" -MATCH "(?((?<ABC>DEF))123|123)(?(ABC)(?<SEC>ABC))"; $Matches
#The group ABC failed matching first and then group SEC wouldn't be executed for matching. The second ABC is not an expression.
#True #Name Value
# ---- ----- # 0 123 "123ABC" -MATCH "(?((?<ABCD>DEF))123|123)(?(ABC)(?<SEC>ABC))"; $Matches #ABCD failed and ABC is executed for matching as an expression.
#True #Name Value
# ---- ----- # SEC ABC # 0 123ABC |
posh | Powershell >