# New Ticket Created by Patrick R. Michaud
# Please include the string: [perl #49135]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=49135 >
There's a probable bug in PGE with processing zero-quantified
captures. When processing a regex that has a capture that can
match zero times, as in
regex foo { ( abc )* }
the resulting Match object should probably have an empty array
in its [0] slot. Currently PGE leaves the [0] slot as non-existent.
The problem is the mechanism that PGE is currently using to handle
backtracking -- when backtracking out of the last (failed) capture,
PGE removes the array that was created to hold it. However, in
the case of a zero-quantified capture, PGE needs to keep the array
as long as the remainder of the expression matches. In other words
PGE needs to create/destroy the array as part of the quantification
node (PGE::Exp::Quant), as opposed to the individual capture elements
as it does now.
Pm