Class MatchFunction
java.lang.Object
com.api.jsonata4java.expressions.functions.FunctionBase
com.api.jsonata4java.expressions.functions.MatchFunction
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"]}]
-
Nested Class Summary
Nested classes/interfaces inherited from class com.api.jsonata4java.expressions.functions.FunctionBase
FunctionBase.CtxEvalResult -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintcom.fasterxml.jackson.databind.JsonNodeinvoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx) Methods inherited from class com.api.jsonata4java.expressions.functions.FunctionBase
evalContext, getArgumentCount, getFunctionName
-
Field Details
-
ERR_BAD_CONTEXT
-
ERR_ARG1BADTYPE
-
ERR_ARG2BADTYPE
-
ERR_ARG3BADTYPE
-
ERR_ARG4BADTYPE
-
-
Constructor Details
-
MatchFunction
public MatchFunction()
-
-
Method Details
-
invoke
public com.fasterxml.jackson.databind.JsonNode invoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx) - Specified by:
invokein classFunctionBase
-
getMaxArgs
public int getMaxArgs()- Specified by:
getMaxArgsin classFunctionBase
-
getMinArgs
public int getMinArgs()- Specified by:
getMinArgsin classFunctionBase
-
getSignature
- Specified by:
getSignaturein classFunctionBase
-