module-common/lib/puppet/parser/functions/re_escape.rb

8 lines
162 B
Ruby
Raw Normal View History

# apply ruby regexp escaping to a string
module Puppet::Parser::Functions
newfunction(:re_escape, :type => :rvalue) do |args|
Regexp.escape(args[0])
end
end