From 8b5ebf23a0fe8ff44116f463d82085ceecc1c55e Mon Sep 17 00:00:00 2001 From: Rohit Jangid Date: Tue, 27 Jun 2023 13:59:18 +0530 Subject: [PATCH] feat: document std.match in standard library --- doc/_stdlib_gen/stdlib-content.jsonnet | 8 ++++++++ stdlib/std.jsonnet | 2 ++ 2 files changed, 10 insertions(+) diff --git a/doc/_stdlib_gen/stdlib-content.jsonnet b/doc/_stdlib_gen/stdlib-content.jsonnet index dd662773d..4ef940742 100644 --- a/doc/_stdlib_gen/stdlib-content.jsonnet +++ b/doc/_stdlib_gen/stdlib-content.jsonnet @@ -387,6 +387,14 @@ local html = import 'html.libsonnet'; Returns a copy of string after eliminating leading and trailing whitespaces. |||, }, + { + name: 'match', + params: ['str', 'pat'], + availableSince: 'upcoming', + description: ||| + Matches the given str using pat as regexp pattern and returns an array of the matches. + |||, + }, { name: 'equalsIgnoreCase', params: ['str1', 'str2'], diff --git a/stdlib/std.jsonnet b/stdlib/std.jsonnet index c861a4aec..5bf1c48ca 100644 --- a/stdlib/std.jsonnet +++ b/stdlib/std.jsonnet @@ -1785,4 +1785,6 @@ limitations under the License. sha3(str):: go_only_function, trim(str):: std.stripChars(str, ' \t\n\f\r\u0085\u00A0'), + + match(str, pat):: go_only_function, }