title: Using grep for multiple search patterns
body: <p>Consider I have the following stream of data:</p>
  
  <pre><code>BODY1
  attrib1:  someval11
  attrib2:  someval12
  attrib3:  someval13
  
  BODY2
  attrib1:  someval21
  attrib2:  someval22
  attrib3:  someval23
  
  BODY3
  attrib1:  someval31
  attrib2:  someval32
  attrib3:  someval33
  </code></pre>
  
  <p>I want to extract <strong>only attrib1 and attrib3</strong> for each BODY, i.e.</p>
  
  <pre><code>attrib1:  someval11
  attrib3:  someval13
  attrib1:  someval21
  attrib3:  someval23
  attrib1:  someval31
  attrib3:  someval33
  </code></pre>
  
  <p>I tried</p>
  
  <p><code>grep 'attrib1\|attrib3'</code>, according to <a href="http://www.cyberciti.biz/faq/searching-multiple-words-string-using-grep/" rel="noreferrer">this site</a> but that returned nothing.  <code>grep attrib1</code> and <code>grep attrib2</code> do return data but just for the single pattern specified.</p>