Roger L. Cauvin wrote: > "Michael Spencer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Roger L. Cauvin wrote: >>>>>"xyz123aaabbab" accept >>>>>"xyz123aabbaaab" reject >>>>>"xayz123aaabab" accept >>>>>"xaaayz123abab" reject >>>>>"xaaayz123aaabab" accept >>>>> >> >>This passes your tests. I haven't closely followed the thread for other >>requirements: >> >> >>> pattern = ".*?(?<![a+b])aaab" #look for aaab not preceded by any a+b > > Very interesting. I think you may have solved the problem. The key seems > to be the "not preceded by" part. I'm unfamiliar with some of the notation. > Can you explain what "[a+b]" and the "(?<!" do?
I think you might need to add a test case involving a pattern of aaaab prior to another aaab. From what I gather (not reading too closely), you would want this to be rejected. Is that true? xyz123aaaababaaabab -Peter -- http://mail.python.org/mailman/listinfo/python-list