I have a string like the following
Every part where there is more than one dot must be replaced by "_" but it must have the same amount as replaced chars.
The string should result in:
Notice that the last dot is not replaced as it has not other dots "connected".
I tried using following regex approach in powershell but I always get a legnth of 2 for the match regardless if there where 3 or more dots:
$string -replace '(.)\1+',("_"*'$&'.length)