title: python: extracting (regex) pattern in a file without going through line by line (multiline search)
body: <p>I can extract a particualr pattern by reading mystring.txt file line by line and checking the line against re.search(r'pattern',line_txt) method.</p>
  
  <p>Following is the mystring.txt</p>
  
  <p>`</p>
  
  <pre><code>Client: //home/SCM/dev/applications/build_system/test_suite_linux/unit_testing
  
  
  
  Stream: //MainStream/testing_branch
  
  Options:    dir, norm accel, ddl
  
  
  
  SubmitOptions:  vis, dir, cas, cat
  </code></pre>
  
  <p>`</p>
  
  <p>using python, I can get the stream name as //MainStream/testing_branch</p>
  
  <pre><code>import re 
  with open("mystring.txt",'r') as f:
      mystring= f.readlines()
      for line in mystring:
          if re.search(r'^Stream\:',line):
  
              stream_name = line.split('\t')[1]
              print stream_name
  </code></pre>
  
  <p>instead of going line by line in a loop, how is it possible to extract the same information by only using the re module?</p>