diff options
author | Nicolas B. Pierron <nicolas.b.pierron@gmail.com> | 2017-08-15T18·34+0000 |
---|---|---|
committer | Nicolas B. Pierron <nicolas.b.pierron@gmail.com> | 2017-08-15T18·34+0000 |
commit | 27417c616073de0800514e79d58c84eaa8019099 (patch) | |
tree | a422283feed750da7a840fea333e381b047ab028 /doc/manual/expressions | |
parent | f76e85d8f581cc8f71b66386e86ed93c2c3d6992 (diff) |
Move builtins.match documentation between map and mul.
Diffstat (limited to 'doc/manual/expressions')
-rw-r--r-- | doc/manual/expressions/builtins.xml | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/doc/manual/expressions/builtins.xml b/doc/manual/expressions/builtins.xml index 229a73fb12ef..86c36da1b328 100644 --- a/doc/manual/expressions/builtins.xml +++ b/doc/manual/expressions/builtins.xml @@ -210,42 +210,6 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""</programlisting> </varlistentry> - <varlistentry><term><function>builtins.match</function> - <replaceable>regex</replaceable> <replaceable>str</replaceable></term> - - <listitem><para>Returns a list if the <link - xlink:href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04">extended - POSIX regular expression</link> <replaceable>regex</replaceable> - matches <replaceable>str</replaceable> precisely, otherwise returns - <literal>null</literal>. Each item in the list is a regex group. - -<programlisting> -builtins.match "ab" "abc" -</programlisting> - -Evaluates to <literal>null</literal>. - -<programlisting> -builtins.match "abc" "abc" -</programlisting> - -Evaluates to <literal>[ ]</literal>. - -<programlisting> -builtins.match "a(b)(c)" "abc" -</programlisting> - -Evaluates to <literal>[ "b" "c" ]</literal>. - -<programlisting> -builtins.match "[[:space:]]+([[:upper:]]+)[[:space:]]+" " FOO " -</programlisting> - -Evaluates to <literal>[ "foo" ]</literal>. - - </para></listitem> - </varlistentry> - <varlistentry><term><function>builtins.elem</function> <replaceable>x</replaceable> <replaceable>xs</replaceable></term> @@ -726,6 +690,42 @@ map (x: "foo" + x) [ "bar" "bla" "abc" ]</programlisting> </varlistentry> + <varlistentry><term><function>builtins.match</function> + <replaceable>regex</replaceable> <replaceable>str</replaceable></term> + + <listitem><para>Returns a list if the <link + xlink:href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04">extended + POSIX regular expression</link> <replaceable>regex</replaceable> + matches <replaceable>str</replaceable> precisely, otherwise returns + <literal>null</literal>. Each item in the list is a regex group. + +<programlisting> +builtins.match "ab" "abc" +</programlisting> + +Evaluates to <literal>null</literal>. + +<programlisting> +builtins.match "abc" "abc" +</programlisting> + +Evaluates to <literal>[ ]</literal>. + +<programlisting> +builtins.match "a(b)(c)" "abc" +</programlisting> + +Evaluates to <literal>[ "b" "c" ]</literal>. + +<programlisting> +builtins.match "[[:space:]]+([[:upper:]]+)[[:space:]]+" " FOO " +</programlisting> + +Evaluates to <literal>[ "foo" ]</literal>. + + </para></listitem> + </varlistentry> + <varlistentry><term><function>builtins.mul</function> <replaceable>e1</replaceable> <replaceable>e2</replaceable></term> |