title: Replace text between two string powershell
body: <p>I have a question which im pretty much stuck on..</p>
  
  <p>I have a file called xml_data.txt and another file called entry.txt</p>
  
  <p>I want to replace everything between <code>&lt;core:topics&gt; and &lt;/core:topics&gt;</code></p>
  
  <p>I have written the below script</p>
  
  <pre><code>$test = Get-Content -Path ./xml_data.txt
  $newtest = Get-Content -Path ./entry.txt
  $pattern = "&lt;core:topics&gt;(.*?)&lt;/core:topics&gt;"
  $result0 = [regex]::match($test, $pattern).Groups[1].Value
  $result1 = [regex]::match($newtest, $pattern).Groups[1].Value
  $test -replace $result0, $result1
  </code></pre>
  
  <p>When I run the script it outputs onto the console it doesnt look like it made any change.</p>
  
  <p>Can someone please help me out</p>
  
  <p>Note: Typo error fixed</p>