CharacterGroup class
Expression that contains a series of characters, or character ranges, that
matches if any character of the input matches element(s) of the group. Can
accept a caret (^
) symbol as first element to apply a negated matching
where it will instead match everything that is not within the group.
Example:
RegExp exp = FancyRegex(
expression: const CharacterGroup(
[
CharacterGroupRange.upperCased(),
CharacterGroupRange.digits(),
],
),
);
print(exp.pattern,); // [A-Z0-9]
final matches = exp.allMatches("FooBar123",);
- Implemented types
- Available Extensions
Constructors
-
CharacterGroup(List<
CharacterGroupRange> ranges, {bool negated = false}) -
Constructs a group that accepts one or more CharacterGroupRanges, and
optionally can use a negated matching
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- negated → bool
-
If
true
, performs a negated matchingfinal -
ranges
→ List<
CharacterGroupRange> -
Character ranges used as filter
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited