$final =~ s/(\$\{$extractedVariable\}/$substituteWith/;