(-raw means you get it as one string rather than an array of strings - useful if the regex is going to operate across lines. If it's only going to operate on one line at a time then leave that off)
$myfile -replace "thing","otherthing" will then do your regex. Replace "thing" with your search regex and "otherthing" with what you want it replaced with.
That'll spit the results out to the command line. When you're happy with it, write it back out to a new file with:
no subject
Date: 2017-11-20 08:22 am (UTC)From:$myfile = get-content C:\tools\testfile.txt -Raw
(-raw means you get it as one string rather than an array of strings - useful if the regex is going to operate across lines. If it's only going to operate on one line at a time then leave that off)
$myfile -replace "thing","otherthing"
will then do your regex. Replace "thing" with your search regex and "otherthing" with what you want it replaced with.
That'll spit the results out to the command line. When you're happy with it, write it back out to a new file with:
$file -replace "thing","otherthing" | Out-File mynewfile.txt -Encoding utf8
(If you leave off the encoding you'll get utf16 by default. Nobody wants that.)