How do I perform multiple replacements with Perl?
- by duenguyen
I have Perl code:
my $s = "The+quick+brown+fox+jumps+over+the+lazy+dog+that+is+my+dog";
I want to replace every + with space and dog with cat.
I have this regular expression:
$s =~ s/\+(.*)dog/ ${1}cat/g;
But, it only matches the first occurrence of + and last dog.