"FOO foo" =~ s/(^| )foo( |$)/${1}bar$2/ig