scan method

bool scan (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) {
  var success = matches(pattern);
  if (success) {
    _position = _lastMatch.end;
    _lastMatchPosition = _position;
  }
  return success;
}