title: grep lines before with pattern "match and not match"
body: <p>Having the following content in the file test.txt:</p>
  
  <pre><code>line 1  
  foo bar  
  line 2  
  foo  
  </code></pre>
  
  <p>I need to <strong>return the line before the line that contains foo but does not contain bar</strong></p>
  
  <p>In the example, the result must be:</p>
  
  <pre><code>line 2  
  foo
  </code></pre>