At Monday 15/1/2007 20:43, Gert Cuykens wrote:

PS i also cant figure out what is wrong here ?

        rex=re.compile('^"(?P<value>[^"]*)"$',re.M)
        for v in l:
            v=rex.match(v).group('value')
            v=v.replace('""','"')
        return(l)

    v=rex.match(v).group('value')
AttributeError: 'NoneType' object has no attribute 'group'

match() returns None when there is no match, so you have to split that in two steps:

m = rex.match(v)
if m:
    v = m.group('value')
else:
    # no match found!


--
Gabriel Genellina
Softlab SRL

        

        
                
__________________________________________________ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to