What is the PowerShell syntax to capture a named group from a [regex] type accelerator expression?
<p>The question uses the following sample string:</p>

<pre><code>$r = 
"20160112 11:26:39 UPDATE CMIS-NC.ABC.LA012345J.NAM/MOUSE, MICKEY J.SEX/M.RAC/W.DOB/19670601.PCA/A1.ARI/CRIM1234567.DNY/CONVICTED OF DISTRIBUTING THE PEACE.OCA/123456.SOR/LA.MIS/CONFIRM RECORD AT DISNEY STUDIOS 123-456-7890 OR PAGER 123-456-7890.
20160112 11:26:39 RESPONSE CMIS-NC.ACK 1234567890 CMIS-NC  123456 CMIS-NC  123456 20160112 11:26:31

.
20160112 11:26:39 INFO MSN of message to LEMS is &lt;1234567890&gt;.
20160112 11:26:39 RESPONSE CMIS-NC.MSG 1234567890 CMIS-NC  123456 NC2K     AC1234 20160112 11:26:31
LA012345J
CTL/
ATN/

6L12345678901234567890EDP 
LA012345J
ACCEPT MKE/EDP
NAM//MOUSE, MICKEY J
ARI/CRIM1234567
NRI/1234567890"
</code></pre>

<p>A named group can be captured using the PowerShell built-in regular expression, by referencing them in the <code>$matches</code> automatic variable:</p>

<pre><code>$updateRequestPattern = "(?&lt;RequestDate&gt;\d{8} \d{2}:\d{2}:\d{2}) (?&lt;UpdateRequest&gt;UPDATE CMIS-NC\.[A-Z]{3,4}\.LA012345J\..+)\n"

$request = $r -match $updateRequestPattern

$matches['RequestDate']
</code></pre>

<p>But what if I instead want to use the <code>[regex]</code> type accelerator? </p>

<p>There, the <code>$matches</code> automatic variable won't work. Neither can I do something like <code>[regex]::Groups['RequestDate'].Value</code> (which produces a "Cannot index into a null array." error).</p>

<p>Can anyone complete this example (or offer another example) to capture named groups (and thus show how other .NET <code>[regex]</code> methods can be exposed)?</p>

<pre><code>$updateRequestPattern = "(?&lt;RequestDate&gt;\d{8} \d{2}:\d{2}:\d{2}) (?&lt;UpdateRequest&gt;UPDATE CMIS-NC\.[A-Z]{3,4}\.LA036035J\..+)\n"
$request = [regex]::Matches($r, $updateRequestPattern)
</code></pre>