Try:
... if ($string =~ /^[ATGC]{8}$/) { ...
Note the caret and dollar-sign. This should match sequences that are exactly eight characters long.
In reply to Re: Why doesn't quantifier work with character classes?
by thezip
in thread Why doesn't quantifier work with character classes?
by rnaeye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |