I am having some issues with regular expression mainly because I think the information I can find is not specifically for powershell and all the samples I have tried either
One way to replace n times:
$test = "My name is Bob, her name is Sara." [regex]$pattern = "name" $pattern.replace($test, "baby", 1) > My baby is Bob, her name is Sara