title: python regex to extract string from log file line
body: <p>i want to extract the data from log file</p>
  
  <p>for open file,</p>
  
  <pre><code>a=open('access.log','rb')
  lines = a.readlines()
  </code></pre>
  
  <p>so suppose line[0]
  123.456.678.89 - - [04/Aug/2014:12:01:41 +0530] "GET /123456789_10.10.20.111 HTTP/1.1" 404 537 "-" "Wget/1.14 (linux-gnu)"</p>
  
  <p>i want to extract only 123456789 and 10.10.20.111 from "GET /123456789_10.10.20.111 HTTP/1.1"</p>
  
  <p>pattern will be like string starts with /,repetition of digit then unserscore then ip</p>
  
  <p>i tried and this work i think it takes overhead</p>
  
  <pre><code>node = re.search(r'\"(.*)\"', line).group(1)
  node = node.split(" ")[1]
  node,ip = node.split("_")
  node = node[1:]
  print node,ip
  </code></pre>
  
  <p>how to  get this with pattern ?</p>