in reply to Regex "or"

Is it possible to write a single substitution that will replace all occurrences of both words in a string?

Sure, take a look at the /g modifier in perlop

Replies are listed 'Best First'.
Re^2: Regex "or"
by Mad_Mac (Beadle) on Mar 20, 2011 at 09:16 UTC

    That's what I thought originally, but then I wasn't getting the results I expected in my more complicated code. Which made me think I was mis-understanding the way /g works.

    Apparently, I was correct to begin with, and I have a different problem with my code :-/