Hi everyone,
I can't get why this code work:
$seq = 'GAGAGAGA';
my $regexp = '(?=((G[UCGA][GA]A)|(U[GA]CG)|(CUUG)))'; # zero width match
while ($seq =~ /$regexp/g){ # globally
my $pos = pos($seq) + 1; # position of a zero width matching
print "$1 position $pos\n";
}
I know this is a zero width match and it dosn't put the matched string in $&, but why does it put it in $1?
thank you!