WordBound class
Allows matching expression that is not preceded/followed by a alphanumeric. A negated variant will match the other way around.
Example:
import 'package:fancy_regex/fancy_regex.dart';
RegExp exp = FancyRegex(
expression: WordBound(
RawExpression("ice",),
start: true,
),
);
print(exp.pattern,); // \bice
exp.hasMatch("justice",); // false
exp.hasMatch("ice queen",); // true
See also: WordBoundary
- Implemented types
- Available Extensions
Constructors
- WordBound(RegExpComponent expression, {bool start = false, bool end = false, bool negated = false})
-
Attach Word Boundary symbol
\b
or\B
(negated form) to expressionconst
Properties
- end → bool
-
If
true
, attach boundary symbol at the end of expressionfinal - expression → RegExpComponent
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- negated → bool
-
If
true
, attach an upper-casedB
instead of lower-casedb
final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- start → bool
-
If
true
, attach boundary symbol at the start of expressionfinal
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