in reply to string match using with an N in any position
There's no reason to be clever. But do note the above code is untested.my $str = "GCGAT"; my @PATS = map { my $s = $str; substr $s, $_, 1, "N"; $s; } 0 .. length($str) - 1; push @PATS, $str; foreach my $str (@PATS) { if (index $value, $str) == 0) { print "Oh, joy, it's a match"; } }
|
|---|