Sha256: e05971952a90e149252426fe290525cf97db7d21582a1eeb0b2f1ae768367a55

Contents?: true

Size: 791 Bytes

Versions: 21

Compression:

Stored size: 791 Bytes

Contents

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 4.0.0
DOC
) do |args|
  function_fail(["match() is only available when parser/evaluator future is in effect"])
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
puppet-4.2.3 lib/puppet/parser/functions/match.rb
puppet-4.2.3-x86-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.2.3-x64-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.2.2 lib/puppet/parser/functions/match.rb
puppet-4.2.2-x86-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.2.2-x64-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.2.1 lib/puppet/parser/functions/match.rb
puppet-4.2.1-x86-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.2.1-x64-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.2.0 lib/puppet/parser/functions/match.rb
puppet-4.2.0-x86-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.2.0-x64-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.1.0 lib/puppet/parser/functions/match.rb
puppet-4.1.0-x86-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.1.0-x64-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.0.0 lib/puppet/parser/functions/match.rb
puppet-4.0.0-x86-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.0.0-x64-mingw32 lib/puppet/parser/functions/match.rb
puppet-4.0.0.rc1 lib/puppet/parser/functions/match.rb
puppet-4.0.0.rc1-x86-mingw32 lib/puppet/parser/functions/match.rb