On 10/29/2013 11:37 AM, Paolo Bonzini wrote: > This patch broke virttest.remote because the new login prompt > incorrectly matches the line "Last login: ..." printed after login by > the F19 JeOS image. > > My suggestion is simply to revert that patch, and also to request > contributors to describe a reproducer when fixing bugs. > > Paolo
This can be fixed with a negative lookbehind, so: r"(?<![Ll]ast).*[Ll]ogin:\s*$" e.g. >>> text = "Last login: blah" >>> text2 = "Login:" >>> print bool(re.search(r"(?<![Ll]ast).*[Ll]ogin:\s*$", text)) False >>> print bool(re.search(r"(?<![Ll]ast).*[Ll]ogin:\s*$", text2)) True -- Chris Evich, RHCA, RHCE, RHCDS, RHCSS Quality Assurance Engineer e-mail: cevich + `@' + redhat.com o: 1-888-RED-HAT1 x44214 _______________________________________________ Virt-test-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/virt-test-devel
