my ($substr) = $s =~ /^((?:[^_]*_){2}[^_]*)/ or die("No match\n");