my $string = "test test %ae, test %ue test, %oe"; my $find = "%(ae|oe|ue)"; #my $replace = '%\1;'; $string =~ s/$find/%\1;/g; print "$string\n";