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') 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 From bb5a6c0085a12221849e51568198121157a02f49 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sun, 11 Dec 2016 17:13:37 +0000 Subject: Document path-search behaviour --- doc/manual/expressions/language-values.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/manual/expressions/language-values.xml b/doc/manual/expressions/language-values.xml index b90baac50..67da688a4 100644 --- a/doc/manual/expressions/language-values.xml +++ b/doc/manual/expressions/language-values.xml @@ -167,7 +167,16 @@ stdenv.mkDerivation { user's home directory. e.g. ~/foo would be equivalent to /home/edolstra/foo for a user whose home directory is /home/edolstra. - + + + Paths can also be specified between angle brackets, e.g. + <nixpkgs>. This means that the directories + listed in the environment variable + NIX_PATH will be searched + for the given file or directory name. + + + Booleans with values true and -- cgit v1.2.3