Philippe Verdy <verd...@wanadoo.fr> added the comment: > Even with your solution, in most of the cases you will need additional steps to assemble the results (at least in the cases with some kind of separator, where you have to join the first element with the followings).
Yes, but this step is trivial and fully predictable. Much more viable than the other solutions proposed which gives tricky and often complex and bogous code. How many bugs have been found in code using split() for example to parse URLs ? There are countlesss in many softwares (and it is not terminated !) And in fine, the only solution is to simply rewrite the parser completely, without regexps at all, or to reduce the generality of the problems that the program was supposed to solve (i.e. asserting in the code some implementation limits, to reject some forms that were previously considered valid). Think about it, the capturing groups are the perfect solution for solving the problem cleanly, provided that they work as intended and return all their occurences. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7132> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com