title: Multi-line regex in Vim: filtering out blocks of text in a file
body: <p>What is the correct regex for filtering multiple-lined blocks of text that end with <code>#tags</code>? My file looks like this:</p>
  
  <pre><code>Text block 1:
  - something
  - something
  - something
  #tag1 #tag2
  
  Text block 2:
  - somethingelse
  - somethingelse
  #tag2
  
  Text block 3:
  - really interesting stuff
  - really interesting stuff
  #tag1
  
  etc
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/784176/multi-line-regex-support-in-vim">These</a> <a href="http://blog.vinceliu.com/2007/12/regular-expression-matching-more-than.html" rel="nofollow noreferrer">great tips</a> pointed me to using <code>\_.</code>. Hence, for filtering out both blocks containing <code>#tag1</code>, I came up with this:</p>
  
  <pre><code>\_.\{-}#tag1.*
  </code></pre>
  
  <p>That, however, only gives me Text block 1. Instead of pointing me further to Text block 2 (which also contains the tag), the cursor starts moving downwards line-by-line.</p>
  
  <p>Where am I going wrong? Thanks for any explanations!</p>
  
  <hr>
  
  <p><strong>EDIT</strong>: A follow-up on how to create a multi-command for this kind of query is <a href="https://stackoverflow.com/questions/10596502/vim-multi-command-for-filtering-out-blocks-of-text">here</a>.</p>