From: rpcee <rp...@op...> - 2002-02-11 18:39:30
|
not an re expert, but grep solves this with -v flag (ie it looks for a match + copies lines that don't), and also unsure what you're input is - a list? ie do you want: [s for s in mylist if not r.match(s)] where mylist contains a list of dates and you want to create a list containing those not matching your re. there's also negation lookahead, I think re.compile('(?!xxx).*'); where xxx is your regular expression below, means: match anything (the .*) but only if the lookahead does not match your re. which I found at a regular expression how to http://py-howto.sourceforge.net/regex/node16.html |