in reply to Re^4: search of a string in another string with 1 wildcard
in thread search of a string in another string with 1 wildcard

Perhaps:

c:\@Work\Perl>perl -wMstrict -le "my @matches = (qr/abcdef/, qr/abfdef/); ;; for my $line (qw(xxxx abcd abcdef xabcdefx xabcdefxabfdefx)) { if ($line ~~ @matches){ print qq{match for '$line'}; } else { print qq{NO match: '$line'}; } } " NO match: 'xxxx' NO match: 'abcd' match for 'abcdef' match for 'xabcdefx' match for 'xabcdefxabfdefx'

Please see docs on smart matching in perlsyn or perlop depending on your Perl version. (Please also note that there have been second thoughts about smart matching and it is now considered 'experimental': proceed at your own risk.