Is there an elegant one-liner for doing the following?
$myMatch = \"^abc(.*)\" $foo -match $myMatch $myVar = $matches[1]
I\'m interested in
I use something like the following pretty often:
([regex]"^abc(.*)").match($foo).groups[1].value
It's not very PowerShell-y, or at least not very PowerShell V2-y (we're falling back onto the .NET class)... but it's pretty compact.