scan method

bool scan(
  1. Pattern pattern
)

If pattern matches at the current position of the string, scans forward until the end of the match.

Returns whether or not pattern matched.

Implementation

bool scan(Pattern pattern) {
  final success = matches(pattern);
  if (success) {
    _position = _lastMatch!.end;
    _lastMatchPosition = _position;
  }
  return success;
}