Is there an elegant one-liner for doing the following?
$myMatch = \"^abc(.*)\" $foo -match $myMatch $myVar = $matches[1]
I\'m interested in
Changed answer after clarification:
True one-liner:
$myvar = ($foo | ? {$_ -match $myMatch} | select @{L="Matches";E={$matches[1]}}).matches
Fake one-liner:
$foo | ? {$_ -match $myMatch} ; $myvar = $matches[1]