findMatchingStrings static method

List<String> findMatchingStrings(
  1. String pattern,
  2. List<String> strings
)

Implementation

static List<String> findMatchingStrings(
    String pattern, List<String> strings) {
  return strings
      .where((item) =>
          RegExp("^${RegExp.escape(item).replaceAll(r'\$', r'[\w-]*')}\$")
              .hasMatch(pattern))
      .toList();
}