matches method
Returns true
if this matches pattern
.
'abc'.matches('abC'); // true
'ab'.matches('abc'); // false
'abcabc'.matches('abc'); // false
Implementation
@useResult bool matches(Pattern pattern) => switch(pattern.matchAsPrefix(this)) {
final match? when match.start == 0 && match.end == length => true,
_ => false,
};