title: Python: How do you split a string if the line starts with "ggggg"?
body: <p>It seems so simple to me, but for some reason I can't get python to split properly on the following.</p>
  
  <pre><code>f = open('text', 'r')
  x = f.read()
  f.close()
  result = x.split('^ggggg', 1)[0]
  </code></pre>
  
  <p>With file "text" having the following:</p>
  
  <pre><code>aaaaa1234
  bbbbb1234
  ccccc1234
  ggggg1234
  hhhhh1234
  </code></pre>
  
  <p>I would think "result" would contain everything before the ggggg line, but it just contains the entire text. How do I get python to split where the front of the line starts with "ggggg"?</p>