while () { if (my ($name_column_deleted) = m/((?:H0|HT)\d{8,}.*)/) { print "$name_column_deleted\n"; } }