Re: Regexp : repeated group identification

2011-12-14 Thread Vlastimil Brom
2011/12/14 candide : ... > > Thanks for the reference and the example. I didn't know of this > reimplementation, hoping it offers the Aho-Corasick algorithm allowing > multiple keys search. > -- > http://mail.python.org/mailman/listinfo/python-list Hi, I am not sure about the underlying algorithm

Re: Regexp : repeated group identification

2011-12-14 Thread candide
Le 14/12/2011 12:34, Vlastimil Brom a écrit : "If a group is contained in a part of the pattern that matched multiple times, the last match is returned." I missed this point, your answer matches my question ;) thanks. If you need to work with the content captured in the repeated group, you

Re: Regexp : repeated group identification

2011-12-14 Thread Vlastimil Brom
2011/12/14 candide : > Consider the following code > > # > import re > > z=re.match('(Spam\d)+', 'Spam4Spam2Spam7Spam8') > print z.group(0) > print z.group(1) > # > > outputting : > > > Spam4Spam2Spam7Spam8 > Spa

Regexp : repeated group identification

2011-12-14 Thread candide
Consider the following code # import re z=re.match('(Spam\d)+', 'Spam4Spam2Spam7Spam8') print z.group(0) print z.group(1) # outputting : Spam4Spam2Spam7Spam8 Spam8 The '(Spam\d)