title: Capture a match with Regex on Python and Assign the captured string value to variable
body: <p>Just started learning python/regex.</p>
  
  <p>I have error log file in which I want to capture the strings that match specific patterns, and create a list from it. There is one error per line. I have the datetime portion down. I need to extract 'company' and 'errorline', assign them to variables, append to my nested list.</p>
  
  <p>The error lines look something like this:</p>
  
  <p><code>2013-02-02 12:20:15 blahblahblah=123214, moreblah=1021, blah.blah.blah, company=201944, errorline=#2043</code></p>
  
  <pre><code>f = open("/path/error.log","r")
  
  errorlist = [["datetime","company","errorline"]]     #I want to append to nested list
  
  for line in f:
      datetime = line[:19]
      company = re.search(r"=[0-9]{6},",line)
      company = company.group[1:-1]                    #to remove the '=' and ','
      errorline = re.search(r"#[0-9]{1,}",line)
      errorline = errorline.group()[1:]
  
      errorlist.append([datetime,company,errorline])
  </code></pre>
  
  <p>I know that this code does not work because I can't assign the .group() to a variable.</p>
  
  <p>Please help!</p>