title: how to replace a string inside perl regex
body: <p>Is there a way to replace characters from inside the regex?</p>
  
  <p>like so: </p>
  
  <pre><code>find x | xargs perl -pi -e 's/(as dasd asd)/replace(" ","",$1)/'
  </code></pre>
  
  <p><strong>From OP's comment</strong></p>
  
  <pre><code>code find x | xargs perl -pi -e 's/work_search=1\/ttype=2\/tag=(.*?)"&gt;(.*?)&lt;\/a&gt;/work\/\L$1\E\" rel=\"follow\"&gt;$2&lt;\/a&gt;/g'
  </code></pre>
  
  <p>in this case i want $1's spaces be replaced with _</p>