my $first_index = index($content, "+_"); my $second_index = index($content, "+_", $first_index); $content = substr($first_index, $first_index - $second_index); #### $content = substr($content, index($content, "+_")+2, index($content, "+_") - index($content, "+_", index($content, "+_")+1)-4);