title: Is there a general way to delete an entire function over multiple lines using sed?
body: <p>Im trying to use the following command to delete a main function, however im getting stuck because I'm left with a &quot;}&quot; and a new line after.</p>
  <p>Here is what I have so far:</p>
  <pre><code>sed -E '/int main/,/return 0\;/ d' program.c
  </code></pre>
  <p>I can't end the matching string with } because inside this main function, there is already a set of closing brackets.</p>