AlternationGroup class
Expression that match one of multiple expressions provided, separated by
a vertical bar (|
).
Given an input, it will look for a match from the expressions, checking one by one, starting from the most left item first, and when a match found, the search ends and the matcher will proceed to look at further unprocessed input tokens.
Example:
import 'package:fancy_regex/fancy_regex.dart';
RegExp exp = FancyRegex(
expression: AlternationGroup(
[
CharacterGroup(
[CharacterGroupRange.lowerCased(),],
),
CharacterGroup(
[CharacterGroupRange.upperCased(),],
),
],
),
);
print(exp.pattern,); // [a-z]|[A-Z]
exp.allMatches("en_US",); // matches "en" and "US"
exp.allMatches("id_ID",); // matches "id" and "ID"
- Implemented types
- Available Extensions
Constructors
-
AlternationGroup(List<
RegExpComponent> expressions) -
Constructs a group that combine expressions into a new expression where
each expression is separated by a vertical bar (
|
), indicating an OR operatorconst
Properties
-
expressions
→ List<
RegExpComponent> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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