my $cur_num = $1 if $arr[$_] =~/\d*[A-Z]_(\d+)$/; my $next_num = $1 if $arr[$_ + 1] =~/\d*[A-Z]_(\d+)$/;