$foo =~ s/bar /baz /x EXPR(1) =~ s/REGEX(2)/STRING_OR_EXPR(3)/MODIFIERS(4) #### my $count=(my $copy=$original)=~s/-(Foo|Bar)-/$1/g;