How to select all text between two patterns where the end pattern might also be a start pattern
<p>Lets say I have the following file</p>

<pre><code>BREAK A
abc
BREAK B
bcd
BREAK A
cde
BREAK A
</code></pre>

<p>What I wish to do is to select everything between <code>BREAK A</code> and <code>BREAK</code>, including the line <code>BREAK A</code> so the desired output is</p>

<pre><code>BREAK A
abc
BREAK A
cde
BREAK A
</code></pre>

<p>None of the awk samples I can find account for the possibility that I might use the same line as both the start and end of a matched segment. </p>

<p>P.S. I'm not sure if this will matter, but in the real file <code>BREAK</code> appears at the start of the line while <code>A</code> and <code>B</code> appears in the middle of a line. </p>