title: Regex delete lines after match
body: <p>I'm trying to match domain example.com and I would like to delete all IPs beneath it</p>
  
  <p>Input:</p>
  
  <pre><code>[example.com]
  10.100.251.1
  10.100.251.2
  10.100.251.3
  [example.net]
  10.100.251.22
  10.100.251.33
  </code></pre>
  
  <p>Desired output: </p>
  
  <pre><code>[example.net]
  10.100.251.22
  10.100.251.33
  </code></pre>
  
  <p>Here is what I have tried so far:</p>
  
  <pre><code>\[example.com\](\s+^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$)*
  </code></pre>
  
  <p>It works, but not sure if thats efficient. </p>
  
  <p>I'm doing my regex testing with rubular here is a sample</p>
  
  <p><a href="http://rubular.com/r/cavVHWPvT2" rel="nofollow">http://rubular.com/r/cavVHWPvT2</a></p>