title: Delete comments in a String?
body: <p>I want to remove simple // comments in a string.
  My String is called input</p>
  
  <pre><code>def input = '''test //kommentar
                |
                |//noch einer
                |
                |und      noch //einer'''.stripMargin()
  </code></pre>
  
  <p>The regex is <code>\s*\/\/.*$</code> and can be tested here <a href="http://regexr.com?37ks0" rel="nofollow">http://regexr.com?37ks0</a></p>
  
  <p>In my code i have <code>input = input.replaceAll(/\s*\/\/.*$/ , '')</code></p>
  
  <p>But it doesn't work. Can anybody help me ?</p>