flatten, flatten(depth)
[Requires 1.5] flatten, flatten(depth)
The filter flatten takes as input an array of nested arrays, and produces a flat array in which all arrays inside the original array have been recursively replaced by their values. You can pass an argument to it to specify how many levels of nesting to flatten.
match(val), match(regex; modifiers)
[Requires 1.5] match(val), match(regex; modifiers)
The filter match(val) performs PCRE regex matching on its input. val can be either a string or an array. If it is an array, the first element is the regex specifier and the optional second element is the modifier flags. The accepted modifier flags are:
test(val), test(regex), test(regex; modifiers)
[Requires 1.5] test(val), test(regex), test(regex; modifiers)
Like match, but does not return match objects, only true or false for whether or not the regex matches the input.
sub(re; sub), gsub(re; sub)
[Requires 1.5] sub(re; sub), gsub(re; sub)
sub(re; sub) replaces with sub the first match of the given regexp re in its input. gsub(re; sub) replaces all matches.
scan(re), split2(re)
[Requires 1.5] scan(re), split2(re)
scan(re) outputs the substrings of its input that match the given regexp re.