Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am having a problem with a specific regular expression. The following code recognizes patterns with 6 letters, seemingly ignoring the G at the end of the regular expression.
while($_=~m/(A\w\w[[CGT]TG|AT[ACT]|A[ACG]G]G)/g){ print pos($_),"\t",$1,"\n"; }
The type of pattern I would like it to return could look like this 'AGTCTGG', but if I run that expression on this string, $1 returns 'AGTCTG'.<\p>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex problem
by Anonymous Monk on Jul 19, 2011 at 14:29 UTC | |
by AnomalousMonk (Archbishop) on Jul 19, 2011 at 18:49 UTC |