I have a parameter in XML files with a mask:

```
<id>ALL2-20210301-XXXXXX-XXXXX_X</id>

```

where ALL2 is always the same parameter, 20210301 is a date so changing every day, and XXXXXX-XXXXX\_X is a variable parameter.

I want to parse XML and get **20210304** value (or other date) with regex - I don't need any other parameter from . How should regular expression value looks like?

code is:

```
[xml]$xml = Get-Content c:\buy\buy.xml
$date= $xml.buy.id[0]
if ($date -match "regex?") {
    $date = $matches[0];
}

```