Awk extract contents between two patterns with least matches
<p>Say I have a file with some lines:</p>

<pre><code>a1 - first match /a/
b - other stuff
a2 - last match /a/
b
c - first match /c/
c - last match /c/
</code></pre>

<p>When I execute <code>awk '/a/,/c/' file</code> I will get</p>

<pre><code>a1 - first match /a/
b - other stuff
a2 - last match /a/
b
c - first match /c/
</code></pre>

<p>What I want to do is to get the middle part between /a/ and /c/. But the pattern /a/ and /c/ matches several lines and between these lines there are some other stuff. So I wonder if there is an easy way to get the result like this:</p>

<pre><code>a2 - last match /a/
b
c - first match /c/
</code></pre>