title: ReplaceAll with java8 lambda functions
body: <p>Given the following variables</p>
  
  <pre><code>templateText = "Hi ${name}";
  variables.put("name", "Joe");
  </code></pre>
  
  <p>I would like to replace the placeholder ${name} with the value "Joe" using the following code (that does not work)</p>
  
  <pre><code> variables.keySet().forEach(k -&gt; templateText.replaceAll("\\${\\{"+ k +"\\}"  variables.get(k)));
  </code></pre>
  
  <p>However, if I do the "old-style" way, everything works perfectly:</p>
  
  <pre><code>for (Entry&lt;String, String&gt; entry : variables.entrySet()){
      String  regex = "\\$\\{" + entry.getKey() + "\\}";          
      templateText =  templateText.replaceAll(regex, entry.getValue());           
     }
  </code></pre>
  
  <p>Surely I am missing something here :) </p>