org.exist.xquery.functions.text
Class RegexpFilter
java.lang.Object
org.exist.xquery.AbstractExpression
org.exist.xquery.PathExpr
org.exist.xquery.Function
org.exist.xquery.BasicFunction
org.exist.xquery.functions.text.RegexpFilter
- All Implemented Interfaces:
- CompiledXQuery, Expression, RewritableExpression, org.xmldb.api.base.CompiledExpression
public class RegexpFilter
- extends BasicFunction
xQuery function for filtering strings from text that match the specified
pattern. E.g. AABBBBCBBC and BB.*BB results in BBBBCBB
| Fields inherited from interface org.exist.xquery.Expression |
DOT_TEST, EXPRESSION_ID_INVALID, IGNORE_CONTEXT, IN_NODE_CONSTRUCTOR, IN_PREDICATE, IN_UPDATE, IN_WHERE_CLAUSE, NEED_INDEX_INFO, NO_CONTEXT_ID, NON_STREAMABLE, POSITIONAL_PREDICATE, SINGLE_STEP_EXECUTION, UNORDERED, USE_TREE_TRAVERSAL |
| Methods inherited from class org.exist.xquery.Function |
accept, analyze, checkArgument, checkArguments, createFunction, dump, getArgument, getArgumentCount, getArguments, getCardinality, getDependencies, getName, getParent, getParentModule, getSignature, isCalledAs, returnsType, setArguments, setParent, setPrimaryAxis, simplify, toString |
| Methods inherited from class org.exist.xquery.PathExpr |
add, add, addPath, addPredicate, allowMixNodesInReturn, dump, getColumn, getContext, getDocumentSet, getExpression, getLastExpression, getLength, getLine, getLiteralValue, getPrimaryAxis, getSubExpression, getSubExpressionCount, isValid, replaceExpression, replaceLastExpression, reset, resetState, setContext, setUseStaticContext |
| Methods inherited from class org.exist.xquery.AbstractExpression |
eval, getContextDocSet, getContextId, getExpressionId, getSource, match, needsReset, setASTNode, setContextDocSet, setContextId, setLocation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FLAGS_PARAM
protected static final FunctionParameterSequenceType FLAGS_PARAM
REGEX_PARAM
protected static final FunctionParameterSequenceType REGEX_PARAM
TEXT_PARAM
protected static final FunctionParameterSequenceType TEXT_PARAM
signatures
public static final FunctionSignature[] signatures
RegexpFilter
public RegexpFilter(XQueryContext context,
FunctionSignature signature)
- Creates a new instance of RegexpMatcher
eval
public Sequence eval(Sequence[] args,
Sequence contextSequence)
throws XPathException
- Description copied from class:
BasicFunction
- Process the function. All arguments are passed in the array args. The number of
arguments, their type and cardinality have already been checked to match
the function signature.
- Specified by:
eval in class BasicFunction
- Throws:
XPathException
filter
public Sequence filter(Sequence[] args)
throws XPathException
- Throws:
XPathException
groups
public Sequence groups(Sequence[] args)
throws XPathException
- Throws:
XPathException
translateRegexp
protected java.lang.String translateRegexp(java.lang.String pattern)
throws XPathException
- Translates the regular expression from XPath2 syntax to java regex
syntax.
- Parameters:
pattern - XPath regexp expression
- Returns:
- Java regexp expression
- Throws:
XPathException
parseFlags
protected static final int parseFlags(java.lang.String s)
throws XPathException
- Throws:
XPathException