title: is it possible to regexp_replace using a function?
body: <p>I would like to do some calculations on a value in a string and finally replace them. Oracles regexp seemes to be good but the \1 gets evaluated at the end of all calcualtions. So I am wondering if I could fore the evaluation before passing it to the function?</p>
  
  <pre><code>set serveroutput on
  
  declare
    l_foo varchar2(4000);
  
    function f_test(i_t varchar2) return varchar2
    is
    begin
      dbms_output.put_line('given parameter: ' || i_t);
      return upper(i_t);
    end;
  begin
    l_foo := regexp_replace(
      'http://www.scoach.com/${asset_type}/${ISIN}?eventtarget=${target}ANDeventvalue=${target_value}'
     ,'\$\{([[:alpha:]_]+)\}'
     ,f_test('\1')
    );
  
    dbms_output.put_line(l_foo);
  end;
  </code></pre>
  
  <p>Gives you a result like:</p>
  
  <pre><code>given parameter: \1
  http://www.scoach.com/asset_type/ISIN?eventtarget=targetANDeventvalue=target_value
  PL/SQL procedure successfully completed.
  </code></pre>