title: How do I access matched objects for replacement when using regular expression mode in PL/SQL Developer Find & Replace?
body: <p>I have a query where I want to replace</p>
  
  <pre><code>avg(j2)
  </code></pre>
  
  <p>with</p>
  
  <pre><code>avg(case when j2 &lt;&gt; 0 then j2 else 0 end)
  </code></pre>
  
  <p>The above is a specific example but the pattern is the same with all the replacements. It's always a word followed by a number that needs to be replaced with the case statement that checks if the number is not 0.</p>
  
  <p>I tried the following for find:</p>
  
  <pre><code>avg(\(\w\d\))
  </code></pre>
  
  <p>and the find works. Now, I want to do a replace so I try:</p>
  
  <pre><code>avg(case when \1 &lt;&gt; 0 then \1 else 0 end)
  </code></pre>
  
  <p>but it puts literal \1 and not the captured text from the match. I tried <code>\\1</code> &amp; <code>$1</code> as well and it takes all of them literally. Can anyone tell me what the right syntax is for using the captured text for replacement? Is this supported?</p>
  
  <p>Thanks,</p>
  
  <p>Ashish</p>