Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Why doesn't quantifier work with character classes?

by thezip (Vicar)
on Aug 13, 2012 at 22:18 UTC ( #987227=note: print w/replies, xml ) Need Help??


in reply to Why doesn't quantifier work with character classes?

Try:

... if ($string =~ /^[ATGC]{8}$/) { ...

Note the caret and dollar-sign. This should match sequences that are exactly eight characters long.


What can be asserted without proof can be dismissed without proof. - Christopher Hitchens, 1949-2011

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987227]
help
Chatterbox?
[Discipulus]: last hour of cb broken..
[erix]: (nothing much happened, anyway)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2018-01-19 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (222 votes). Check out past polls.

    Notices?