Re: re.finditer with lookahead and lookbehind

2012-06-20 Thread MRAB
On 20/06/2012 14:30, Christian wrote: Hi, i have some trouble to split a pattern like s. Even have this problems with the first and last match. Some greedy problems? Thanks in advance Christian import re s='v1=pattern1&v2=pattern2&v3=pattern3&v4=pattern4&v5=pattern5&x1=patternx' pattern =r'

re.finditer with lookahead and lookbehind

2012-06-20 Thread Christian
Hi, i have some trouble to split a pattern like s. Even have this problems with the first and last match. Some greedy problems? Thanks in advance Christian import re s='v1=pattern1&v2=pattern2&v3=pattern3&v4=pattern4&v5=pattern5&x1=patternx' pattern =r'(?=[a-z0-9]+=)(.*?)(?<=&)' regex = re.co