- All Implemented Interfaces:
- Function, Serializable
public class MatchFunction
extends FunctionBase
implements Function
From http://docs.jsonata.org/string-functions.html:
$match(str, pattern [, limit])
Finds occurrences of pattern within str and reports them with their index and
group.
If str is not specified, then the context value is used as the value of str.
It is an error if str is not a string.
The pattern parameter must be a regular expression (regex) String used for
searching the string.
The optional limit parameter, is a number that specifies the maximum number
of results to be found before stopping.
Examples
$match("John Smith and John Jones", "John") ==
"[{"match":"John","index":0,"groups":["John"]},{"match":"John","index":15,"groups":["John"]}]
- See Also:
- Serialized Form