regex - get last occurrence before match : <p>With regex, from the following sentence</p>

<pre><code>my name is oscar my name is oscar my name is oscar my name is david my name is oscar
</code></pre>

<p>I would like to get the "oscar" immediately previous to david (in this case would be the 3rd "oscar")</p>

<p>I've tried many things but none of them have worked.</p>

<p>Any ideas? Thanks</p>
