title: What should I use the Non-greedy match in this case
body: <p>Assume I have a string which includes some data fields that are separated by "|", like
  |1|2|3|4|5|6|7|8|</p>
  
  <p>My purpose is to get the 8th field. This is what I'm doing:</p>
  
  <pre><code>pattern = re.compile(r'^\s+(\|.*?\|){8}')
  match = pattern.match(test_line)
  if match:
     print:match.group(8)
  </code></pre>
  
  <p>But looks like it can not match. I know in this case I need to use ? for non-greedy match, but why I can not get the 8th field?</p>
  
  <p>Thanks</p>