use warnings; use strict; my @tests = ("this is+ +test", "this+test", "morepluses+++++++test"); for (@tests) { s/\++/ /g; #multiple+ to single space (see note) print "$_\n"; } __END__ this is test this test morepluses test or could use this regex to also compress spaces: s/[\s\+]+/ /g; #multiple spaces or + to single space this is test this test morepluses test #### use warnings; use strict; my @tests = ("this is+ +test", "this+test", "morepluses+++++++test"); for (@tests) { tr /+/ /; #lower overhead than the regex engine print "$_\n"; } __END__ this is test this test morepluses test