title: Groovy regex. Matching begining of the line
body: <p>I am little puzzled by Groovy regex behavior.</p>
  
  <pre><code>"dog" == /dog/ - return true
  
  "dog" == /^dog/ - return false
  </code></pre>
  
  <p>My understanding that ^ matches start of the line so second expression should return true as well.</p>
  
  <p>What I am actually trying to do is to replace "#" at beginning of the line using</p>
  
  <pre><code>line = line.replace(/^#/, '')
  </code></pre>
  
  <p>but "#" does not get removed</p>