extractWords function

List<String> extractWords(
  1. String text
)

Implementation

List<String> extractWords(String text) {
  final wordRegExp = RegExp(r'\b\w+\b');
  return wordRegExp.allMatches(text).map((match) => match.group(0)!).toList();
}