On 13 Nov 2012, at 9:04 AM, Niphlod <niph...@gmail.com> wrote: > seems a problem with the default regex checking for args.... Let's wait for > Jonathan > > >>> import re > >>> mymatch = re.compile(r'([\w@ -]+[=.]?)*$') > >>> mymatch.match('a') > <_sre.SRE_Match object at 0x02A61020> > >>> mymatch.match('Abbbbbbbb Lccc - Pddddddd GA Deeeeee (ffff ffff A).pdf') > > endless loop of backtracing regex
I don't have a quick fix. The easy solutions involve re elements not available in Python re (or at least not until 3.1). A workaround would be to make the pattern a little more lenient: [\w@ -=.]+ If we really want to exclude successive dots or equals, we could make a separate check for that. --