On May 2, 9:17 am, Flyzone <[EMAIL PROTECTED]> wrote: > On 30 Apr, 20:00, Steven Bethard <[EMAIL PROTECTED]> wrote: ... > Maybe a right approach will be another if after the first one? Like: > for y in range(0, len(skip_lst) ): > if (re.search(skip_lst[y], line)): > if > (re.search(skip_lst_negative[y], line)): > skip=1 > break > and in the rule-file, i could add a new column and check to do the if > just if the second column is not empty.
This is quite a common approach for this sort of matching problem - having includes and excludes patterns, and having the test return True if the include matches but not the exclude. Trying to roll the two into one requires pretty unreadable regexes if it is possible at all... -- http://mail.python.org/mailman/listinfo/python-list