Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: string match using with an N in any position

by JavaFan (Canon)
on Nov 18, 2011 at 10:04 UTC ( #938768=note: print w/replies, xml ) Need Help??

in reply to string match using with an N in any position

Just be pragmatic:
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"; } }
There's no reason to be clever. But do note the above code is untested.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938768]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (14)
As of 2016-10-27 14:35 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (364 votes). Check out past polls.