function vowelsCounter(text) {
// Search text with Regex and store all matching instances
let matchingInstances = text.match(/[aeiou]/gi);
// Check if matching instances exist then calculate length
if (matchingInstances) {
// Return number of vowels
return matchingInstances.length
} else {
return 0
}
}
-> 정규표현식을 사용하여 모음의 갯수를 찾아내는 함수