Class CharacterClass
java.lang.Object
easyIO.regexp.RegExp
easyIO.regexp.CharacterClass
A set of characters (Unicode codepoints), matching any one character in the set.
The set is represented canonically as sorted, disjoint, non-adjacent ranges, so
that equal sets are equal regular expressions; a negated class is stored as the
complement of its ranges.
-
Nested Class Summary
Nested classes/interfaces inherited from class RegExp
RegExp.DerivTerm -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RegExpAny one character except a line break ('\n' or '\r').static RegExpanyChar()Any one character.voidappendString(StringBuilder b, int precedence) Append a string representation of the regular expression to the builder b.computeDerivative(int codepoint) booleancontains(int codepoint) Whether codepoint is in this class.booleanstatic RegExpexcludeRange(int start, int end) Any one character not from start to end.inthashCode()booleannullable()Whether this RE matches the empty stringstatic RegExpof(int[] ranges, boolean negated) A canonical RE matching any one character in the given ranges, or any one character not in them if negated.static RegExprange(int start, int end) Any one character from start to end, inclusive.Methods inherited from class RegExp
derivative, hasCaptures, isVoid, nullOps, termDerivative, toString
-
Method Details
-
of
A canonical RE matching any one character in the given ranges, or any one character not in them if negated. The ranges are given as pairs (start0, end0, start1, end1, ...), inclusive, in any order, possibly overlapping. An empty set is void, and a single character is a string. -
range
Any one character from start to end, inclusive. -
excludeRange
Any one character not from start to end. -
anyChar
Any one character. -
anyButLineBreak
Any one character except a line break ('\n' or '\r'). This is the meaning of '.' in a pattern. -
contains
public boolean contains(int codepoint) Whether codepoint is in this class. -
nullable
-
computeDerivative
-
appendString
Description copied from class:RegExpAppend a string representation of the regular expression to the builder b. The precedence of the surrounding context is provided so that necessary parentheses can be added. Precedences: 0 = top level 1 = | 2 = concat 3 = star- Specified by:
appendStringin classRegExp
-
equals
-
hashCode
-