title: Python: Line that does not start with #
body: <p>I have a file that contains something like</p>
  
  <blockquote>
    <p># comment<br>
    # comment<br>
     not a comment</p>
    
    <p># comment<br>
    # comment<br>
     not a comment</p>
  </blockquote>
  
  <p>I'm trying to read the file line by line and only capture lines that does not start with #. What is wrong with my code/regex?</p>
  
  <pre class="lang-py prettyprint-override"><code>import re
  
  def read_file():
      pattern = re.compile("^(?&lt;!# ).*")
  
      with open('list') as f:
          for line in f:
              print pattern.findall(line)
  </code></pre>
  
  <p>Original code captures everything instead of expected.</p>