I haven't worked with it myself, but maybe PPIx::Regexp is worth looking into. I suspect that similar to PPI, it probably doesn't support the full range of Perl features.
However it sounds like you might want to be using named capture groups with unique names rather than plain numbered capture groups?
In reply to Re: Is there an easy way to parse and modify regular expressions programmatically
by Anonymous Monk
in thread Is there an easy way to parse and modify regular expressions programmatically
by DrWhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |