Regex for multi line search that should select text "abc" which comes before the text "xyz" and should not select anything except "abc" : <p>Regex for multi line search that should select text "abc" which comes before the text "xyz" and should not select anything except "abc"</p>

<p>suppose if the text is as below,</p>

<pre><code>    aaaabbbb
    abc
     abc
 lmn xyz
</code></pre>

<p>the regex should match only the text abc in 3rd line just above last line</p>
