use Sort::Key::Multi 'isikeysort'; @sorted = isikeysort { /^(\d+)(\w+)(\d+)$/ } @a;