title: Error trying to pass regex match to function
body: <p>I'm getting <code>Syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$'</code></p>
  
  <p>This is the code i'm using</p>
  
  <pre><code>function wpse44503_filter_content( $content ) {
      $regex = '#src=("|\')'.
          '(/images/(19|20)(0-9){2}/(0|1)(0-9)/[^.]+\.(jpg|png|gif|bmp|jpeg))'.
          '("|\')#';
      $replace = 'src="'.get_site_url( $2 ).'"';
  
      $output = preg_replace( $regex, $replace, $content );
  
      return $output;
  }
  </code></pre>
  
  <p>This is the line where i'm getting that error <code>$replace = 'src="'.get_site_url( $2 ).'"';</code></p>
  
  <p>Can anyone help me to fix it?
  Thanks</p>