while ($dna1 =~ s/\s/GA{ACT}TC/g){ print "Found GA{ACT}TC at", pos($dna1)-4, "\n"; }
If you've read pos then you will notice it says 'Returns the offset of where the last "m//g" search left off' but you are not using m//g.
Your message says "Found GA{ACT}TC" but your search pattern is /\s/ which is a single whitespace character.
By "pos($dna1)-4" I assume that you want the start of the pattern but a single whitespace character is only one character long and the string "GA{ACT}TC" is 9 characters long?
In reply to Re: RegEx and Packaging Name Problem
by jwkrahn
in thread RegEx and Packaging Name Problem
by blarsen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |