in reply to Matching all text after a specific character

#!/usr/bin/perl -l # http://perlmonks.org/?node_id=1170310 use strict; use warnings; while(<DATA>) { /.*(_.*_.*)/ and print $1; } __DATA__ XYX_WT_7_25h_Trimmed_75.SAM some_other_name bad_name one_two_three_four_five_six