in reply to What's missing in Perl 5.10
More seriously, one thing that's seriously missing is structured captures. With the addition of named captures, (?(DEFINE)...), and (more convenient) recursive patterns, the regex engine has all the necessary ingredients to implement fast recursive-descent parsers.
Well, all but one: there's no convenient way to get at the structure of the match to build up a parse tree. The raw materials to do so are there: you can take actions in code blocks and have them undone during backtracking via local; you can refer to capture groups by relative position and name so that embedded subpatterns work. But it's an enormous pain to put these ingredients together in any but the most trivial cases.
|
|---|