title: Terraform replace regex
body: <p>I have a terraform template file. <code>example.tpl</code></p>
  
  <p>And I would like to remove all the lines that start with <code>#</code></p>
  
  <p>I have 3 lines that start with <code>#</code> in the top of the file:</p>
  
  <pre><code># Comment1
  # Comment2
  # Comment3
  &lt;Content of the file&gt;
  </code></pre>
  
  <p>I'm trying to do the replacement in the following manner:</p>
  
  <pre><code>data "template_file" "example" {
    template = "${replace(file("example.tpl"),"/^#.*\n/", "")}"
  }
  </code></pre>
  
  <p>And for some reason in the rendered output I can see that only one the first line is removed.</p>
  
  <p>I.e. I'm getting</p>
  
  <pre><code># Comment2
  # Comment3
  &lt;Content of the file&gt;
  </code></pre>
  
  <p>What could be the problem?
  Thanks.</p>