# Find the mark. $str =~ /_{70}/ and substr($str, 0, $+[0], ''); # Replace everything up to right after # the match with the empty string.