static int count(String word) { word = word.toLowerCase(); final vowels = RegExp(r'[aeiouy]+'); final matches = vowels.allMatches(word); return matches.isEmpty ? 1 : matches.length; }