unable to parse the content using the regular expression

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Sep 29 16:41:29 EDT 2008


En Thu, 25 Sep 2008 05:30:41 -0300, <dudeja.rajat at gmail.com> escribió:

> I've the following results from Difflib.Compare() which I want to parse  
> them
> using the regular expression to find out the the values that have  
> changed.
>
>   Results:-
>   -------
>
> - Analysis Time (Iterations = 1) = 0.0449145s
> ?                                       ^^ ^
> + Analysis Time (Iterations = 1) = 0.0447347s
> ?                                       ^^ ^
>
>
> Here I want to display only the values that differ i.e. the lines prceded
> with +,?,- signs >

Instead of parsing that generated file (intended for human usage), use  
difflib.Differ or difflib.SequenceMatcher - you get a programming  
interface to the same info, easier to use in a script.

-- 
Gabriel Genellina




More information about the Python-list mailing list