public final class Sequences extends Object
Sequences.| Modifier and Type | Class and Description |
|---|---|
static class |
Sequences.LiteralString
Representation of a sequence of literal, case-sensitive characters.
|
| Modifier and Type | Field and Description |
|---|---|
static de.unkrig.lfr.core.Sequence |
TERMINAL
Matches the empty string, and is the last element of any
CompositeSequence chain. |
| Modifier and Type | Method and Description |
|---|---|
static de.unkrig.lfr.core.Sequence |
alternatives(de.unkrig.lfr.core.Sequence[] alternatives)
Creates and returns
Sequence that returns the first match of one alternatives plus
this sequence's successor. |
static de.unkrig.lfr.core.Sequence |
beginningOfInput()
Implements
"^" with ! |
static de.unkrig.lfr.core.Sequence |
beginningOfLine()
Implements
"^" with MULTILINE. |
static de.unkrig.lfr.core.Sequence |
beginningOfUnixLine()
Implements
"^" with MULTILINE and UNIX_LINES. |
static de.unkrig.lfr.core.Sequence |
capturingGroupEnd(int groupNumber)
Implements
")". |
static de.unkrig.lfr.core.Sequence |
capturingGroupStart(int groupNumber)
Implements
"(". |
static de.unkrig.lfr.core.Sequence |
endOfInput()
Implements
"$" with ! |
static de.unkrig.lfr.core.Sequence |
endOfInputButFinalTerminator()
Implements
"\Z". |
static de.unkrig.lfr.core.Sequence |
endOfInputButFinalUnixTerminator()
Implements
"\Z". |
static de.unkrig.lfr.core.Sequence |
endOfLine()
Implements
"$" with MULTILINE. |
static de.unkrig.lfr.core.Sequence |
endOfPreviousMatch()
Implements
"\G". |
static de.unkrig.lfr.core.Sequence |
endOfUnixLine()
Implements
"$" with MULTILINE and UNIX_LINES. |
static de.unkrig.lfr.core.Sequence |
greedyQuantifierOfAnyChar(int min,
int max,
Sequences.LiteralString ls)
Implements a greedy quantifier on an "any char" operand, followed by a literal String.
|
static de.unkrig.lfr.core.Sequence |
greedyQuantifierOfCharacterClass(CharacterClass operand,
int min,
int max)
Optimized version of
#greedyQuantifierSequence(Sequence, int, int) when the operand is a bare
character predicate, e.g. a character class. |
static de.unkrig.lfr.core.Sequence |
independentNonCapturingGroup(de.unkrig.lfr.core.Sequence[] alternatives)
Creates and returns a
Sequence that matches the alternatives, and, after the first matching
alternative, matches its successor. |
static de.unkrig.lfr.core.Sequence |
linebreak()
A sequence that matches a linebreak; implements
"\R". |
static de.unkrig.lfr.core.Sequence |
negate(de.unkrig.lfr.core.Sequence op)
Creates and returns a sequence that produces a zero-width match iff the op does not match,
and otherwise (iff the op does match) does not match.
|
static de.unkrig.lfr.core.Sequence |
positiveLookahead(de.unkrig.lfr.core.Sequence op)
Implements {@code "(?
|
static de.unkrig.lfr.core.Sequence |
positiveLookbehind(de.unkrig.lfr.core.Sequence op)
Implements {@code "(?
|
static de.unkrig.lfr.core.Sequence |
possessiveQuantifier(de.unkrig.lfr.core.Sequence operand,
int min,
int max)
Implements a "possessive" quantifier for an operand.
|
static de.unkrig.lfr.core.Sequence |
quantifier(de.unkrig.lfr.core.Sequence operand,
int min,
int max,
int counterIndex,
boolean greedy)
Implements greedy and reluctant (but not possessive) quantifiers.
|
static de.unkrig.lfr.core.CompositeSequence |
reluctantQuantifierOfAnyChar(int min,
int max,
Sequences.LiteralString ls)
Implements a reluctant quantifier on an "any char" operand, followed by a literal String.
|
static de.unkrig.lfr.core.Sequence |
unicodeWordBoundary()
Implements
"\b", and, negated, "\B". |
static de.unkrig.lfr.core.Sequence |
wordBoundary()
Implements
"\b", and, negated, "\B". |
public static final de.unkrig.lfr.core.Sequence TERMINAL
CompositeSequence chain.public static de.unkrig.lfr.core.Sequence quantifier(de.unkrig.lfr.core.Sequence operand,
int min,
int max,
int counterIndex,
boolean greedy)
public static de.unkrig.lfr.core.CompositeSequence reluctantQuantifierOfAnyChar(int min,
int max,
Sequences.LiteralString ls)
Examples: ".*?ABC" ".{3,17}?ABC"
public static de.unkrig.lfr.core.Sequence possessiveQuantifier(de.unkrig.lfr.core.Sequence operand,
int min,
int max)
public static de.unkrig.lfr.core.Sequence alternatives(de.unkrig.lfr.core.Sequence[] alternatives)
Sequence that returns the first match of one alternatives plus
this sequence's successor.
For example, "a(b|bb)c" will match both "abc" and "abbc". (In the second case, matching
"abc" fails, but matching "abbc" eventually succeeds.)independentNonCapturingGroup(Sequence[])public static de.unkrig.lfr.core.Sequence independentNonCapturingGroup(de.unkrig.lfr.core.Sequence[] alternatives)
Sequence that matches the alternatives, and, after the first matching
alternative, matches its successor.
For example, "a(?>b|bb)c" will match "abc" but not "abbc". (In the second case,
matching "ab" succeeds, "abb" is never tried.)alternatives(Sequence[])public static de.unkrig.lfr.core.Sequence capturingGroupStart(int groupNumber)
"(".public static de.unkrig.lfr.core.Sequence capturingGroupEnd(int groupNumber)
")".public static de.unkrig.lfr.core.Sequence beginningOfInput()
"^" with !MULTILINE, and "\A".public static de.unkrig.lfr.core.Sequence beginningOfLine()
"^" with MULTILINE.public static de.unkrig.lfr.core.Sequence beginningOfUnixLine()
"^" with MULTILINE and UNIX_LINES.public static de.unkrig.lfr.core.Sequence endOfInputButFinalTerminator()
"\Z".public static de.unkrig.lfr.core.Sequence endOfInputButFinalUnixTerminator()
"\Z".public static de.unkrig.lfr.core.Sequence endOfInput()
"$" with !MULTILINE, and "\z".public static de.unkrig.lfr.core.Sequence endOfLine()
"$" with MULTILINE.public static de.unkrig.lfr.core.Sequence endOfUnixLine()
"$" with MULTILINE and UNIX_LINES.public static de.unkrig.lfr.core.Sequence linebreak()
"\R".public static de.unkrig.lfr.core.Sequence wordBoundary()
"\b", and, negated, "\B".public static de.unkrig.lfr.core.Sequence unicodeWordBoundary()
"\b", and, negated, "\B".public static de.unkrig.lfr.core.Sequence endOfPreviousMatch()
"\G".public static de.unkrig.lfr.core.Sequence positiveLookahead(de.unkrig.lfr.core.Sequence op)
"(?=X)".public static de.unkrig.lfr.core.Sequence positiveLookbehind(de.unkrig.lfr.core.Sequence op)
"(?<=X)".public static de.unkrig.lfr.core.Sequence greedyQuantifierOfCharacterClass(CharacterClass operand, int min, int max)
#greedyQuantifierSequence(Sequence, int, int) when the operand is a bare
character predicate, e.g. a character class.public static de.unkrig.lfr.core.Sequence greedyQuantifierOfAnyChar(int min,
int max,
Sequences.LiteralString ls)
Examples: ".*ABC" ".{3,17}ABC"
public static de.unkrig.lfr.core.Sequence negate(de.unkrig.lfr.core.Sequence op)
Copyright © 2017 Arno Unkrig. All rights reserved.