in reply to Re^4: Print A Sequence with Start codon and different Stop Codon
in thread Print A Sequence with Start codon and different Stop Codon

Nope.

"(??{ code })" is used so the regex fails and backtracks. It's the backtracking that finds every answer.

  • Comment on Re^5: Print A Sequence with Start codon and different Stop Codon

Replies are listed 'Best First'.
Re^6: Print A Sequence with Start codon and different Stop Codon
by Anonymous Monk on Oct 28, 2015 at 13:52 UTC
    perlre says:
    This is a "postponed" regular subexpression. It behaves in exactly the + same way as a (?{ code }) code block as described above, except that + its return value, rather than being assigned to $^R , is treated as +a pattern, compiled if it's a string (or used as-is if its a qr// obj +ect), then matched as if it were inserted instead of this construct.
    so what is treated as a pattern here? is it what "print $1" returns?

      The print returns 1, which becomes a pattern that will not be matched, so the regex fails and backtracks.