HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/match.rb
Puppet::Parser::Functions::newfunction(
  :match,
  :arity => 2,
  :doc => <<-DOC
Returns the match result of matching a String or Array[String] with one of:

* Regexp
* String - transformed to a Regexp
* Pattern type
* Regexp type

Returns An Array with the entire match at index 0, and each subsequent submatch at index 1-n.
If there was no match `undef` is returned. If the value to match is an Array, a array
with mapped match results is returned.

Example matching:

  "abc123".match(/([a-z]+)[1-9]+/)    # => ["abc"]
  "abc123".match(/([a-z]+)([1-9]+)/)  # => ["abc", "123"]

See the documentation for "The Puppet Type System" for more information about types.

- since 3.7.0
- note requires future parser
DOC
) do |args|
  function_fail(["match() is only available when parser/evaluator future is in effect"])
end