From 41d6523ef57c3b35483eeef7cb85eb6c6a84aeb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Fri, 9 Dec 2016 20:40:55 +0100 Subject: Document builtins.match, fixes #1145 --- doc/manual/expressions/builtins.xml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'doc/manual') diff --git a/doc/manual/expressions/builtins.xml b/doc/manual/expressions/builtins.xml index 9517f2010..063bc04be 100644 --- a/doc/manual/expressions/builtins.xml +++ b/doc/manual/expressions/builtins.xml @@ -210,6 +210,35 @@ if builtins ? getEnv then builtins.getEnv "PATH" else "" + builtins.match + regex str + + Returns a list if + regex matches + str precisely, otherwise returns null. + Each item in the list is a regex group. + + +builtins.match "ab" "abc" + + +Evaluates to null. + + +builtins.match "abc" "abc" + + +Evaluates to [ ]. + + +builtins.match "a(b)(c)" "abc" + + +Evaluates to [ "b" "c" ]. + + + + builtins.elem x xs -- cgit v1.2.3