CharacterSet class final
A set of characters that can be used to match against code points. This is used to define constraints for generation of string and runes.
Constructors
- CharacterSet.new()
- Creates an empty character set.
- CharacterSet.all(CharacterEncoding encoding)
-
Creates a character set that contains characters of
all Unicode categories.
factory
- CharacterSet.alphanum(CharacterEncoding encoding)
-
Creates a character set that contains alphanumeric characters of
Unicode categories
L*
,M*
,N*
.factory - CharacterSet.bitDigit()
-
Creates a character set that contains binary digit characters
(
0
,1
) of ASCII.factory - CharacterSet.digit(CharacterEncoding encoding)
-
Creates a character set that contains numeric characters of
Unicode category
Nd
.factory - CharacterSet.fromCharacters(String characters)
-
Creates a character set from a string of characters.
factory
-
CharacterSet.fromCodePoints(List<
int> codePoints) -
Creates a character set from a list of code points.
factory
- CharacterSet.hexDigit()
-
Creates a character set that contains hexadecimal digit characters
(
0-9a-fA-F
) of ASCII.factory - CharacterSet.letter(CharacterEncoding encoding)
-
Creates a character set that contains letter characters of
Unicode categories
L*
,M*
.factory - CharacterSet.lower(CharacterEncoding encoding)
-
Creates a character set that contains lowercase characters of
Unicode categories
Ll
.factory - CharacterSet.octalDigit()
-
Creates a character set that contains octal digit characters
(
0-7
) of ASCII.factory - CharacterSet.symbol(CharacterEncoding encoding)
-
Creates a character set that contains symbol characters of
Unicode categories
S*
.factory - CharacterSet.upper(CharacterEncoding encoding)
-
Creates a character set that contains uppercase characters of
Unicode categories
Lu
,Lt
.factory - CharacterSet.whitespace(CharacterEncoding encoding)
-
Creates a character set that contains whitespace characters of
Unicode categories
Z*
.factory - CharacterSet.whitespaceAndNewline(CharacterEncoding encoding)
-
Creates a character set that contains CharacterSet.whitespace and
CharacterSet.newline characters.
factory
- CharacterSet.newline(CharacterEncoding encoding)
-
Creates a character set that contains newline characters of
Unicode categories
Cc
and0x000A, 0x000B, 0x000C, 0x000D, 0x0085, 0x2028, 0x2029
code points.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addCharacters(
String string) → void - Adds characters to the character set.
-
addCharacterSet(
CharacterSet other) → void - Adds characters of the given character set to the character set.
-
addCodePoints(
List< int> codePoints) → void - Adds code points to the character set.
-
contains(
int codePoint) → bool - Returns whether the character set contains the given code point or not.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited