title: REGEXP_REPLACE back-reference
body: <p>I have went through the documentation of Oracle regarding <code>REGEXP_REPLACE</code> function, but it didn't work as expected</p>
  
  <p>Here is what I got:</p>
  
  <hr>
  
  <p><strong>My target:</strong> concatenate a character for each set of continuous numbers</p>
  
  <p><strong>My input:</strong></p>
  
  <pre><code>(1101 + 1102) * 1103 + 1104 + 1105
  </code></pre>
  
  <p><strong>Expected output:</strong></p>
  
  <pre><code>(T1101 + T1102) * T1103 + T1104 + T1105
  </code></pre>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>SELECT
    REGEXP_REPLACE('(1101 + 1102) * 1103 + 1104 + 1105',
                   '[0-9]+',
                   'T\1') "REZ"
    FROM DUAL;
  </code></pre>
  
  <p><strong>Result I've got:</strong></p>
  
  <pre><code>(T\1 + T\1) * T\1 + T\1 + T\1
  </code></pre>
  
  <hr>
  
  <p>I've searched many Stack-overflow posts, and they all seems to have this scenario working without any problems regarding the \1</p>
  
  <p>Also tried different places to test the code: Tod for oracle, SqlPlus and another application, they all gave me the same results.</p>
  
  <p>So, would anyone please tell me whats wrong with my code ?</p>
  
  <p><strong><em>Note:</em></strong></p>
  
  <p><em>I don't suspect that my regular expression has any problems, tested before in a different scenario in oracle, and its working.  Plus, matches are found, but the replacement part is not working.</em></p>
  
  <p>References of some Stack-overflow posts:</p>
  
  <p><a href="//stackoverflow.com/questions/11238487/regex-replace-not-working-as-expected-in-oracle-10g" rel="nofollow">Ref1</a>, <a href="//stackoverflow.com/questions/12584261/oracle-sql-regexp-replace-matching" rel="nofollow">Ref2</a>, <a href="//stackoverflow.com/questions/24763025/oracle-regexp-replace-with-group" rel="nofollow">Ref3</a></p>
  
  <p>Reference to Oracle Documentation:</p>
  
  <p><a href="http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions130.htm" rel="nofollow">REGEXP_REPLACE</a></p>