Skip to content

Instantly share code, notes, and snippets.

@ahpook
Created June 24, 2015 20:17
Show Gist options
  • Save ahpook/a1b9d97c83ae64e846b2 to your computer and use it in GitHub Desktop.
Save ahpook/a1b9d97c83ae64e846b2 to your computer and use it in GitHub Desktop.
regexp backrefences in node
[vagrant@glitched sample_pp]$ FACTER_fqdn=des-bwq0t01 puppet apply ./hyphen_node.pp
Notice: Scope(Node[__node_regexp__des-bweqs0-9t0-9]): matched des-bwq
Notice: Compiled catalog for glitched.vmlocal in environment production in 0.30 seconds
Notice: Applied catalog in 0.01 seconds
[vagrant@glitched sample_pp]$ cat hyphen_node.pp
node /(des-bw[eqs])[0-9]t[0-9]+/ {
notice("matched $1")
}
node default {
notice("nope")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment