posh.regex | greed.lazy

"A" -MATCH "\w*"
#True
"A" -MATCH "\w+"
#True
"?" -MATCH "\w+"
#False
"?" -MATCH "\w*"
#True
"?" -MATCH "\w??"
#True
"??" -MATCH "\w??"
#True
"??" -MATCH "^\w??$"
#False
 
"123" -match "\d"; $Matches
"123" -match "\d?"; $Matches
"123" -match "\d*"; $Matches
"123" -match "\d+?"; $Matches
"123" -match "\d*?"; $Matches
 
<#
 True
Name                           Value
----                           -----
0                              1
True
0                              1
True
0                              123
True
0                              1
True
0
#>
 
Comments