Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Re3: BioInformatics - polyA tail search

by runrig (Abbot)
on Sep 02, 2003 at 19:14 UTC ( #288390=note: print w/replies, xml ) Need Help??


in reply to Re: Re3: BioInformatics - polyA tail search
in thread BioInformatics - polyA tail search

Also note that you probably want to match against [AN]{10,} so that if there are more than 10 A's or N's in a row the match does not fail.
If there are more than ten, then {10} will match just fine.

Replies are listed 'Best First'.
Re: Re: Re: Re3: BioInformatics - polyA tail search
by fletcher_the_dog (Friar) on Sep 02, 2003 at 19:59 UTC
    I wrote a little test script to test if you were right (and you were), so my question is what use is the upper range indicator? I thought it allowed you to limit the number of times that something matched, but apparently it does not.
    #!/usr/bin/perl use strict; my $seq = "ANANNNNANANANANANANANANANANA"; if ($seq=~/[AN]{10,11}?/) { print "I matched\n"; } else { print "I did not match!\n"; } __OUTPUT__ I matched
      A comma in the range is useful if you are matching something after the sequence, or if you are using capturing parenthesis to save the matched sequence. If you only want to match sequences of 10 and not longer, you would need a negative-lookahead (see perlre) after the {10}.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2020-05-25 06:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (143 votes). Check out past polls.

    Notices?