You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to parse certain strings belonging to certain kinds of languages, recursive patterns for recursive matching are necessary. For example, if you want to parse and capture a parenthesized chunk of text which may contain nested parenthesis, you'll need to have recursion.
Perl already supports recursive matching, so does PCRE and with that many libraries for languages such as PHP. I always wondered why the Python regex engines never did.
Please could you provide a set of tests, checking what the groups should match, including the expected results of the matched.captures() method. Try to make them short but thorough.
Note that Perl allows backtracking into the recursive part, whereas PCRE doesn't (it treats the recursive part as atomic).
Original report by Anonymous.
In order to parse certain strings belonging to certain kinds of languages, recursive patterns for recursive matching are necessary. For example, if you want to parse and capture a parenthesized chunk of text which may contain nested parenthesis, you'll need to have recursion.
Perl already supports recursive matching, so does PCRE and with that many libraries for languages such as PHP. I always wondered why the Python regex engines never did.
Please refer to http://perldoc.perl.org/perlre.html for documentation on the widely accepted syntax for recursive patterns.
The text was updated successfully, but these errors were encountered: