#!/usr/bin/perl use strict; use warnings; my $str=qq/\n\t\t\t\t\t\tABC*99-211!*A/; my ($erg) = $str =~ /\n\t\t\t\t\t\t([*a-zA-Z0-9_\-!]+)/g; print $erg;