net.sf.saxon.functions.regex
Interface RegexIterator

All Superinterfaces:
SequenceIterator
All Known Implementing Classes:
JRegexIterator

public interface RegexIterator
extends SequenceIterator

This class is an interator 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
static interface RegexIterator.OnGroup
          Interface defining a call-back action for processing captured groups
 
Field Summary
 
Fields inherited from interface net.sf.saxon.om.SequenceIterator
GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD
 
Method Summary
 String getRegexGroup(int number)
          Get a substring that matches a parenthesised group within the regular expression
 SequenceIterator getRegexGroupIterator()
          Get a sequence containing all the regex captured groups relating to the current matching item (except group 0, because we want to use indexing from 1).
 boolean isMatching()
          Determine whether the current item in the sequence is a matching item or a non-matching item
 void processMatchingSubstring(XPathContext context, RegexIterator.OnGroup 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, current, getAnother, getProperties, next, position
 

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

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

getRegexGroupIterator

SequenceIterator getRegexGroupIterator()
Get a sequence containing all the regex captured groups relating to the current matching item (except group 0, because we want to use indexing from 1). This is used by the saxon:analyze-string() higher-order extension function.


processMatchingSubstring

void processMatchingSubstring(XPathContext context,
                              RegexIterator.OnGroup action)
                              throws XPathException
Process a matching substring, performing specified actions at the start and end of each matching group

Throws:
XPathException


Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.