title: Notepad++ Regex Backreference syntax in Search/Replace - \1 or $1
body: <p>I have tried to use the Notepad++ Search/Replace with a Regular Expression to replace specific words with shorter versions of those words.</p>
  
  <hr>
  
  <p>I used the following regex to match every word that ends with <code>er</code> (but not <code>er</code> as a word) - and replace the matching words with the same words minus the ending <code>r</code>, using a backreference:</p>
  
  <p><em><code>Find what:</code></em> <strong><code>([a-zA-z]+e)r</code></strong></p>
  
  <p><em><code>Replace with:</code></em> <strong><code>$1</code></strong></p>
  
  <p>But it doesn't replace the matching words, even though it finds them.</p>
  
  <p><strong>However, if I change the backreference syntax to this:</strong> </p>
  
  <p><em><code>Replace with:</code></em> <strong><code>\1</code></strong> </p>
  
  <p>Everything works fine.</p>
  
  <hr>
  
  <p>Why doesn't the <code>$1</code> backreference work?</p>
  
  <p>What is the difference between the two forms of the backrefernce - <code>\1</code> and <code>$1</code>?</p>