Wesley Witt wrote: > > This is probably a simple question, but I can't seem to find the answer > anywhere. > > I want a regular expression that will match ALL lines that do NOT contain > the string "skip". I have some backup logs that I need to filter the noise > out of. Why use a regular expression? You can do something like this (untested): for line in fileinput.readlines(): if line.find("skip")==-1: print line For me, regular expressions are a last resort because they are hard to read later and often slower than string methods. -- Take a recipe. Leave a recipe. Python Cookbook! http://www.ActiveState.com/pythoncookbook
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4