query
On this page

match

lib.match

Primop
Docs pulled from | This Revision | 1 day ago

Takes 2 arguments

regex, str


Returns a list if the extended POSIX regular expression 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.match "[[:space:]]+([[:upper:]]+)[[:space:]]+" "  FOO   "

Evaluates to [ "FOO" ].


Noogle detected

Aliases

Detected Type
match :: String -> String -> Bool

Implementation

This function is implemented in c++ and is part of the native nix runtime.