Here's what we have in OSC:
https://github.com/opscode/chef_objects/blob/master/src/chef_regex.erl#L65