title: 'negative' pattern matching in python
body: <p>I have the following input,</p>
  
  <pre><code>OK SYS 10 LEN 20 12 43
  1233a.fdads.txt,23 /data/a11134/a.txt
  3232b.ddsss.txt,32 /data/d13f11/b.txt
  3452d.dsasa.txt,1234 /data/c13af4/f.txt
  .
  </code></pre>
  
  <p>And I'd like to extract all of the input <em>except</em> the line containing
  "<code>OK SYS 10 LEN 20</code>" and the last line which contains a single <code>"."</code> (dot).
  That is, I want to extract the following </p>
  
  <pre><code>1233a.fdads.txt,23 /data/a11134/a.txt
  3232b.ddsss.txt,32 /data/d13f11/b.txt
  3452d.dsasa.txt.1234 /data/c13af4/f.txt
  </code></pre>
  
  <p>I tried the following,</p>
  
  <pre><code>for item in output:
      matchObj = re.search("^(?!OK) | ^(?!\\.)", item)
      if matchObj:
          print "got item "  + item
  </code></pre>
  
  <p>but it does not work, as it does not produce any output. </p>