stringMatches method

List<String>? stringMatches(
  1. String input, {
  2. int start = 0,
  3. int? stop,
  4. bool reverse = true,
})

Returns the list of substring matches found in input.

start and stop refer to the indexes of the delimited blocks of text. Only matches found between start and stop will be returned.

start must not be null and must be >= 0.

stop may be null and must be >= start.

Implementation

List<String>? stringMatches(
  String input, {
  int start = 0,
  int? stop,
  bool reverse = true,
}) {
  assert(start >= 0);
  assert(stop == null || stop >= start);
  final matches =
      getMatches(input, start: start, stop: stop, reverse: reverse);
  return matches
      ?.map((match) => input.substring(match.start, match.end))
      .toList();
}