Package net.sf.saxon.regex
Interface RegexIterator
-
- All Superinterfaces:
AutoCloseable,Closeable,SequenceIterator<StringValue>
- All Known Implementing Classes:
ARegexIterator,JRegexIterator
public interface RegexIterator extends SequenceIterator<StringValue>
This interface defines an iterator that supports the evaluation of xsl:analyze-string. It returns all the matching and non-matching substrings in an input string, and provides access to their captured groups
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceRegexIterator.MatchHandlerInterface defining a call-back action for processing captured groups
-
Field Summary
-
Fields inherited from interface net.sf.saxon.om.SequenceIterator
ATOMIZING, GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetNumberOfGroups()Get the number of captured groups in the current matching itemStringgetRegexGroup(int number)Get a substring that matches a parenthesised group within the regular expressionbooleanisMatching()Determine whether the current item in the sequence is a matching item or a non-matching itemvoidprocessMatchingSubstring(RegexIterator.MatchHandler action)Process a matching substring, performing specified actions at the start and end of each matching group-
Methods inherited from interface net.sf.saxon.om.SequenceIterator
close, forEachOrFail, getProperties, materialize, next
-
-
-
-
Method Detail
-
isMatching
boolean isMatching()
Determine whether the current item in the sequence is a matching item or a non-matching item- Returns:
- true if the current item is a matching item
-
getNumberOfGroups
int getNumberOfGroups()
Get the number of captured groups in the current matching item
-
getRegexGroup
String getRegexGroup(int number)
Get a substring that matches a parenthesised group within the regular expression- Parameters:
number- the number of the group to be obtained- Returns:
- the substring of the current item that matches the n'th parenthesized group within the regular expression
-
processMatchingSubstring
void processMatchingSubstring(RegexIterator.MatchHandler action) throws XPathException
Process a matching substring, performing specified actions at the start and end of each matching group- Throws:
XPathException
-
-