Il 29/10/2013 18:52, Chris Evich ha scritto: > 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*$"
Looks good, thanks. Paolo > 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 > _______________________________________________ Virt-test-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/virt-test-devel
