title: python re matching the "space at the end of string"
body: <p>original re expression given by MOOC instructor is </p>
  
  <pre><code>^(\S+) (\S+) (\S+) \[([\w:/]+\s[+\-]\d{4})\] "(\S+) (\S+)\s*(\S*)" (\d{3}) (\S+)
  </code></pre>
  
  <p>I think the catch here is there is an extra space at the end of HTTP/1.0 for bad ones, anyone can hint to make a minor change to make it parse <strong>BOTH</strong> successfully?
  I tried to change (\S*) to (?:\s+|$) or (\S.*) and it did not work either way.</p>
  
  <h1>good one below</h1>
  
  <pre><code>127.0.0.1 - - [01/Aug/1995:00:00:01 -0400] "GET /images/launch-logo.gif HTTP/1.0" 200 1839
  </code></pre>
  
  <h1>bad one below</h1>
  
  <pre><code>Invalid logline: ix-li1-14.ix.netcom.com - - [08/Aug/1995:14:47:41 -0400] "GET /shuttle/missions/sts-70/mission-sts-70.html HTTP/1.0 " 200 20304
  </code></pre>