my @array = qw{ eins zwei/*test drei vier test*/fuenf sechs }; my @new; my $found = 0; for my $string (@array) { if ($found) { if ($string =~ s{ .* \*/ }{}x) { $found = 0; push @new, $string; } } else { if ($string =~ s{ /\* .* }{}x) { $found = 1; } push @new, $string; } }