Метод matchAsPrefix
Сопоставляет этот шаблон с началом string.
Возвращает совпадение, если шаблон соответствует подстроке string, начиная с start, и null, если шаблон не совпадает в этой точке.
Значение start должно быть неотрицательным и не превышать string.length.
final string = 'Dash is a bird'; var regExp = RegExp(r'bird'); var match = regExp.matchAsPrefix(string, 10); // Match found. regExp = RegExp(r'bird'); match = regExp.matchAsPrefix(string); // null
Реализация
Match? matchAsPrefix(String string, [int start = 0]);
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-core/Pattern/matchAsPrefix.html