My code captures a string of numbers from another file using regex (.\*) There should always be a minimum of four numbers 

The output may be

1456 or 234567

But let’s say it’s

3667876

I want to add ‘km ’ before the last three digits a ‘m’ after the last three digits. So resulting in

3667km 876m

The line of code in the Powershell script is 

```
Get-Content -Tail 0 -Wait -Encoding "UTF8" $log | 
  Select-String "Run Distance: (.*)" |
   % {"Total Distance `- " + $_.matches.groups[1].value} |
    Write-SlowOutput -outputFile $output -waitFor $delay

```

So in this case the output would read

Total Distance - 3667km 876m

Can anyone help with the regex formula to use in place of the (.\*) in this Powershell script.

Thank you