c$CD = 'A_TAG_HSSL_LBA_1'; $t=$CD; if($t1 !~ /A_[A_Z0-9_]+/i) { print "$t is not matching\n"; } else { print "$t matches\n"; }