title: Oracle REGEX to match two consecutive 'a'
body: <p>I am trying to replace two consecutive <code>aa</code> in the oracle database using <code>REGEXP_REPLACE</code>.</p>
  <p>The SQL I tried so far is below</p>
  <pre><code>   select regexp_replace('aab','(a)(a)|(a)(a)','\1 \2 \3') from dual;
  </code></pre>
  <p>The expected result is <code>a ab</code> and the actual result is <code>a a b</code>.</p>
  <p>Basically, I want <code>(a)(a)</code> to match with two consecutive <code>aa</code>.What is the regular expression I must use?</p>
  <p>Please note I am using this particular SQL as a  workaround if there are more than three or more consecutive <code>a</code></p>
  <pre><code>select regexp_replace('aaa','(a)(a)|(a)(a)','\1 \2 \3') from dual;
  </code></pre>
  <p>gives me the result  <code>a a a</code> which is expected.</p>