Package net.sf.saxon.regex
Class Operation.OpReluctantFixed
java.lang.Object
net.sf.saxon.regex.Operation
net.sf.saxon.regex.Operation.OpRepeat
net.sf.saxon.regex.Operation.OpReluctantFixed
- Enclosing class:
- Operation
Handle a reluctant repetition (with possible min and max) where the
size of the repeated unit is fixed.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.saxon.regex.Operation
Operation.OpAtom, Operation.OpBackReference, Operation.OpBOL, Operation.OpCapture, Operation.OpCharClass, Operation.OpChoice, Operation.OpEndProgram, Operation.OpEOL, Operation.OpGreedyFixed, Operation.OpNothing, Operation.OpReluctantFixed, Operation.OpRepeat, Operation.OpSequence, Operation.OpTrace, Operation.OpUnambiguousRepeat
-
Field Summary
Fields inherited from class net.sf.saxon.regex.Operation.OpRepeat
greedy, max, min, op
Fields inherited from class net.sf.saxon.regex.Operation
MATCHES_ZLS_ANYWHERE, MATCHES_ZLS_AT_END, MATCHES_ZLS_AT_START, MATCHES_ZLS_NEVER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get the length of the matches returned by this operation if they are fixed-lengthiterateMatches
(REMatcher matcher, int position) Get an iterator returning all the matches for this operationint
Ask whether the regular expression is known, after static analysis, to match a zero-length stringOptimize the operationMethods inherited from class net.sf.saxon.regex.Operation.OpRepeat
containsCapturingExpressions, display, getInitialCharacterClass, getMinimumMatchLength, getRepeatedOperation
-
Constructor Details
-
OpReluctantFixed
OpReluctantFixed(Operation op, int min, int max, int len)
-
-
Method Details
-
getMatchLength
public int getMatchLength()Description copied from class:Operation
Get the length of the matches returned by this operation if they are fixed-length- Overrides:
getMatchLength
in classOperation.OpRepeat
- Returns:
- the length of the matches, or -1 if the length is variable
-
matchesEmptyString
public int matchesEmptyString()Description copied from class:Operation
Ask whether the regular expression is known, after static analysis, to match a zero-length string- Overrides:
matchesEmptyString
in classOperation.OpRepeat
- Returns:
- a value indicating whether the regex is statically known to match
a zero-length string. Specifically:
- returns
Operation.MATCHES_ZLS_AT_START
if the expression is statically known to match a zero-length string at the start of the supplied input; - returns
Operation.MATCHES_ZLS_AT_END
if it is statically known to return a zero-length string at the end of the supplied input; - returns
Operation.MATCHES_ZLS_ANYWHERE
if it is statically known to match a zero-length string anywhere in the input. - returns
Operation.MATCHES_ZLS_NEVER
if it is statically known that the regex will never match a zero length string.
- returns
-
optimize
Description copied from class:Operation
Optimize the operation- Overrides:
optimize
in classOperation.OpRepeat
- Parameters:
program
- the program being optimizedflags
- the regular expression flags- Returns:
- the optimized operation
-
iterateMatches
Description copied from class:Operation
Get an iterator returning all the matches for this operation- Overrides:
iterateMatches
in classOperation.OpRepeat
- Parameters:
matcher
- supplies the context for the matching; may be updated with information about captured groupsposition
- the start position to seek a match- Returns:
- an iterator returning the endpoints of all matches starting at the supplied position
-