extractEmails method

List<String> extractEmails()

Extracts all valid email addresses from the string.

@return A list of extracted email addresses.

Implementation

List<String> extractEmails() {
  final emailRegex = RegExp(r'[\w\.-]+@[\w\.-]+\.\w+');
  return emailRegex.allMatches(this).map((match) => match.group(0)!).toList();
}