title: Terraform Replace Regex not working correctly
body: <p>I have a regex to replace any non word characters, underscores or spaces in one of my variables to sanitise the name to pass it to Route53.</p>
  
  <p>It is replacing non alphanumeric and underscores but it is getting stuck on spaces.</p>
  
  <p>I know the regex is <code>\s</code> for whitespaces but it seems to be ignoring it when the Terraform plan runs but if I run it through a regex checker it works fine.</p>
  
  <pre><code>identifier        = "qa-${lower(replace(var.dns_name,"/\\W|_|\\s/","-"))}"
  </code></pre>