Class OpBackReference


  • public class OpBackReference
    extends Operation
    A back-reference in a regular expression
    • Method Detail

      • matchesEmptyString

        public int matchesEmptyString()
        Ask whether the regular expression is known, after static analysis, to match a zero-length string
        Specified by:
        matchesEmptyString in class Operation
        Returns:
        false. Returning true means that the expression is known statically to match ""; returning false means that this cannot be determined statically; it does not mean that the expression does not match "". We cannot do the analysis statically where back-references are involved, so we return false.
      • iterateMatches

        public IntIterator iterateMatches​(REMatcher matcher,
                                          int position)
        Description copied from class: Operation
        Get an iterator returning all the matches for this operation
        Specified by:
        iterateMatches in class Operation
        Parameters:
        matcher - supplies the context for the matching; may be updated with information about captured groups
        position - the start position to seek a match
        Returns:
        an iterator returning the endpoints of all matches starting at the supplied position
      • display

        public java.lang.String display()
        Display the operation as a regular expression, possibly in abbreviated form
        Specified by:
        display in class Operation
        Returns:
        the operation in a form that is recognizable as a regular expression or abbreviated regular expression