title: Groovy literal regex /\\/ is not compiling
body: <p>I have a path in Windows:</p>
  
  <pre><code>assert f.toString() == 'C:\\path\\to\\some\\dir'
  </code></pre>
  
  <p>I need to convert the backslashes <code>\</code> to forward slashes <code>/</code>. Using Java syntax, I would write:</p>
  
  <pre><code>assert f.toString().replaceAll('\\\\', '/') == 'C:/path/to/some/dir'
  </code></pre>
  
  <p>But I am studying Groovy, so I thought I would write a literal regular expression:</p>
  
  <pre><code>assert f.toString().replaceAll(/\\/, '/') == 'C:/path/to/some/dir'
  </code></pre>
  
  <p>This throws a compilation error:</p>
  
  <blockquote>
    <p>unexpected token: ) ==  at line: 4, column: 42</p>
  </blockquote>
  
  <p>I started looking on the internet, and found several comments suggesting that this particular regex literal would not work, instead you would have to use a workaround like <code>/\\+/</code>. But this obviously changes the semantics of the regex.</p>
  
  <p>I cannot really understand why <code>/\\/</code> does not work. Maybe somebody does?</p>