title: Removing pattern matched line from multiline string in python
body: <p>I have a multiline text string, that looks like:</p>
  
  <pre><code>AAAA BBBBBB
  BBBB VVVV XXXX
  
  CCCCCCCC XXXX
  </code></pre>
  
  <p>I'd like to come up with a small function that removes an entire line if it contains a word/phrase , so that for above if I lets say sent in 'VVV' as a paremeter the output would be:</p>
  
  <pre><code>AAAA BBBBBB
  
  CCCCCCCC XXXX
  </code></pre>
  
  <p>There are many examples on stackoverflow, eg <a href="https://stackoverflow.com/questions/11968998/remove-lines-that-contain-certain-string">Remove lines that contain certain string</a>, which show how to do this for a file, but I'm not sure how without opening a file.</p>