title: Search for text between two patterns with multiple lines in between
body: <p>I have a simple question. I have a file containing:</p>
  
  <pre><code>more random text
  
  *foo*
  there
  is 
  random
  text
  here
  *foo*
  
  foo
  even
  more
  random
  text
  here
  foo
  more random text
  </code></pre>
  
  <p>(to clarify between which parts i want the result from, i added the *'s next to foo. The *'s are not in the file.)</p>
  
  <p>I only want to print out the multiple lines between the first 2 instances of foo. </p>
  
  <p>I tried searching for ways to let "foo" occur only once and then remove it. But i didnt get that far. However i did find the way to remove all the "more random text" using: sed '/foo/,/foo/p' but i couldnt find a way using sed, or awk to only match ones and print the output. </p>
  
  <p>Can anyone help me out?</p>