parse static method

List<StringTemplate> parse(
  1. String value
)

Parse the given value and extract all templated values.

Implementation

static List<StringTemplate> parse(String value) {
  final matches = StringTemplate.regExp.allMatches(value);
  return matches
      .map(
        (match) => StringTemplate(
          match.start,
          match.end,
          match.input.substring(match.start, match.end),
          match.group(1)!,
          match.group(3) ?? 'String',
          match.group(5),
        ),
      )
      .toList();
}