|The stupid question is the question not asked
Re^3: Regex to replace a particular part of contentby GrandFather (Saint)
|on Jun 23, 2006 at 18:10 UTC
Now do it when you don't know what the text is up front and the text varies from line to line.
With this version you might as well just have used a print statement containing the litteral output. I'm sure in OP's real problem the text is not as shown. A better sample may have comprised words like "foo bar baz" and been much shorter, but there were enough lines there that you should probably have been able to read between them. :).
DWIM is Perl's answer to Gödel