Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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.


Comment on Re: string match using with an N in any position
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-08-02 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (53 votes), past polls