[Edit]
+
0
-
0

js count vowels in string using regex

1 2 3 4 5 6 7 8
const regex = /[aeiouy]/g; const text = 'Count vowels in this text.'; const result = text.match(regex); if (result) { console.log(result.length); // 7 }