title: Powershell -creplace doesn't find Expression at end of line
body: <p>I'm trying to find and replace some text at the end of line with Powershell. (ascii, txt, windows) I need to do this with a given script, which is already used for string replace:</p>
  
  <pre><code>$inputText = [system.IO.File]::ReadAllText("Text.txt")
  
  $regex = '\\DE$|\DE_02'
  
  $regex &gt; test.txt
  
  $th = [system.IO.File]::ReadAllText("test.txt")
  
  foreach($expression in $th) {
  
   if ($expression -eq 'EOF') { break }
  
   $parts = $expression.Split("|")
  
   if ($parts.Count -eq 2) {
  
       $inputText = $InputText -creplace $parts
  
       echo $inputText | out-file "Text_neu.txt" -enc ascii
   }
  }
  </code></pre>
  
  <p>The cmdlet works fine so far, but cannot match the end of line ($) -.-
  I also tried `r`n instead of $ but didn't work...</p>
  
  <p>When I try like this:</p>
  
  <pre><code>$inputText = [system.IO.File]::ReadAllText("Text.txt")
  
  $inputText.Replace("\DE\`r\`n","\DE_02\`r\`n") | Out-File Text_neu.txt
  </code></pre>
  
  <p>it's al replaced correctly.</p>
  
  <p>How can I change the existing script so that it  will work also?</p>