http://www.perlmonks.org?node_id=1046978


in reply to how to guess mutual frases?

You could use regexp to extract names:
my @files = (qw( hhk_1sss-(hello).txt hhk_2abc-(hello).txt hhk_3xyz-(hello).txt )); my @new_files = map { /^.*_(\d[a-z]{3}).*(\.txt)$/; "$1$2" } @files;