Thanks, that's a neat trick - I hadn't realised you could still capture
things from within a lookahead.
Richard
> On Jun 24, Richard Adams said:
>
>> @peptides = $sequence =~ /(\w{4}S\w{4})/g;
>>
>> this works up to a point, but if there are 2 adjacent 'S' the 2nd one
>> is not extracted, I guess because the regexp engine continues after the
>> end of the previous match ie., it doesn't extract DFRSSSGHY above.
>
> Here's the trick for you:
>
> @peptides = $sequence =~ /(?=(\w{4}S\w{4}))/g;
>
> The (?=...) assertion "looks ahead" in the string for the pattern, without
> actually advancing in the string when it's done. In this way, we capture
> something without advancing past it.
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]