PowerShell - Regular Expressions
Identify the error in this PowerShell snippet using named captures:
$text = 'User: JohnDoe' if ($text -match '(?\w+)') { Write-Output $matches.user }
