title: regex match one string only if line does not contain another string
body: <p>Is there a general regex for matching one string, but only if a line does not contain another string? </p>
  
  <p>E.g I want to match the word <code>apple</code> but only if the line does not contain <code>banana</code>. So the following lines: </p>
  
  <ol>
  <li><code>apple banana</code> - does not match</li>
  <li><code>pear apple</code> - matches apple but not pear </li>
  <li><code>apple pear apple</code> - matches the first and second apple but not the pear </li>
  </ol>
  
  <p>I know that </p>
  
  <pre><code>^((?!banana).)*$
  </code></pre>
  
  <p>will match a line that does not contain banana. But I can't seem to combine that with matching apple only.</p>