title: How to match the whole traceback message and not stop early using regex
body: <p>Here's the python code:</p>
  
  <pre><code>st = """
  Traceback (most recent call last):
    File "/builder_task.py", line 279, in do_one_task
      raise RecoverableBuildException("test error")
  common.exceptions.BuildException: test error
  """
  
  st2 = """
  Traceback (most recent call last):
    File "/builder_task.py", line 279, in do_one_task
      raise RecoverableBuildException("test error")
  common.exceptions.BuildException
  """
  
  EXCEPTION_PATTERN = re.compile(
      r"Traceback \(most recent call last\):(?s).*?([\w\.]*(?:Exception|Error))(: .*?\n)?"
  )
  ex_match = EXCEPTION_PATTERN.findall(st)
  ex_match2 = EXCEPTION_PATTERN.findall(st2)
  </code></pre>
  
  <p>I expect to match the whole stacktrace and capture </p>
  
  <p><code>("common.exceptions.BuildException", ": test error")</code> for st
  <code>("common.exceptions.BuildException", "")</code> for st2</p>
  
  <p>however it matched from beginning to "raise RecoverableBuildException" and captured </p>
  
  <p><code>('RecoverableBuildException', '')</code> for st and <code>('', '')</code> for st2</p>