Re^8: Parsing and translating Perl Regexes ( PPIx::Regexp::xplain ppixregexplain.pl _desc.pl )by Anonymous Monk
|on Nov 11, 2013 at 00:51 UTC||Need Help??|
The "\g10" thing was an out-and-out bug, caused by blindly reblessing backreferences over and above the number of capture groups present. Only things of the form \10 should be so reblessed.
The failure to recognize /foo/aia as equivalent to /foo/aai is also a bug.
The thing with recognizing /foo/ad as /foo/d is more problematic, partly because my design goal was never to distinguish valid regexes from invalid ones, but only to parse valid ones "correctly". The practical problems are that I can't do anything about the error at the point I might detect it, since the code at that point needs to consider also stuff fed in from (e.g.) "use re '/x';". So for the moment nothing is going to be done about those.
On the other hand, I have come up with a method on PPIx::Regexp::Element (i.e. inherited by all PPIx::Regexp objects) that will tell whether a given modifier is asserted. I'm sure there are all sorts of edge cases that I have not considered, but in "/(?-i:foo)/i" it correctly says /i is _not_ asserted on the "f".
Unfortunately I am looking at a very busy week, and probably will not get anything published until very late in the week at the earliest.