title: Retrivieng specific occurrences of a given Regex with Oracle SQL
body: <p>In a simplified form, I'm attempting to retrieve either the first occurrence of the <code>'.*?=(.*?);.*'</code> regex, or the second, or the third -- that is, either <code>x</code> or <code>y</code> or <code>z</code> (that is, I want to be able to hardcode in this query that I want the first, second or third values) in this following example:</p>
  
  <pre><code>select regexp_replace(
    'margin=x;margin=y;margin=z;',
    '.*?=(.*?);.*',
    '\1',
    1 -- occurrences. I thought that picking 1, 2 or 3 would solve my problem?
  ) from dual;
  
  -- This returns "xyz", which is terrible. I was expecting it to return "x", in this case.
  </code></pre>
  
  <p>Looking at the Oracle documentation, I thought this would be relatively straightforward, as the last parameter (occurrences), apparently allows me to select which groups to take into consideration. But it doesn't! Why?</p>
  
  <p>Thanks</p>