my $re = ; chomp ($re); my $line = ; chomp ($line); print "$line =~ /$re/\n"; if ( $line =~ /$re/ ) { print "match"; } else { print "no match"; } #### a\d3 a23 #### a23 =~ /a\d3/ match