title: Vim trailing characters search
body: <p>I know I have to escape regex special characters in a search and replace in vim, but I can't see what I'm missing here.  I do this:</p>
  
  <pre><code>:%s/RAILS_ROOT/Rails\.root\.to_s/gj
  </code></pre>
  
  <p>and I get the "trailing characters" error in Vim.</p>
  
  <p>I have also tried escaping the _ the same way, just in case, same result.  Any idea what I'm missing?</p>
  
  <p>Thanks</p>