Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$len beeing the length of a word. I always get only the first encounter but never all hits? Why is it so? I guess it has something to do with $len because without it I get all encounters. Thank you in advance.while($allseq =~ /(ct(?:a|g)a(?:c|t))(?:.{$len})/g) {push(@array, $1);}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex /g and interpolated lengths
by tirwhan (Abbot) on Nov 15, 2005 at 21:45 UTC | |
by Anonymous Monk on Nov 15, 2005 at 21:57 UTC | |
by tirwhan (Abbot) on Nov 15, 2005 at 22:07 UTC | |
by Anonymous Monk on Nov 15, 2005 at 22:10 UTC | |
by duff (Parson) on Nov 15, 2005 at 22:18 UTC | |
| |
by tirwhan (Abbot) on Nov 15, 2005 at 22:14 UTC | |
by tirwhan (Abbot) on Nov 15, 2005 at 22:32 UTC | |
| |
by Anonymous Monk on Nov 15, 2005 at 22:03 UTC | |
|
Re: Regex /g and interpolated lengths
by Roy Johnson (Monsignor) on Nov 15, 2005 at 21:44 UTC | |
|
Re: Regex /g and interpolated lengths
by duff (Parson) on Nov 15, 2005 at 21:45 UTC |