title: String substitution in Puppet?
body: <p>Is it possible to do a string substitution/transformation in Puppet using a regular expression?</p>
  
  <p>If $hostname is "web1", I want $hostname_without_number to be "web". The following isn't valid Puppet syntax, but I think I need something like this:</p>
  
  <pre><code>$hostname_without_number = $hostname.gsub(/\d+$/, '')
  </code></pre>