PowerShell - String Operations
Why does this code fail?
$text = 'abc'
if ($text -match '\d+') { $Matches[0] }$text = 'abc'
if ($text -match '\d+') { $Matches[0] }-match '\d+' returns false.$Matches[0] is not executed, so no error occurs. The code runs fine.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions