Its simple and easy.. just write a function and match for regex and return the output like below
function:function getVowels(str) { var m = str.match(/[aeiou]/gi); return m === null ? 0 : m.length;}getVowels("Anshul"); //output --> 2getVowels("TRY"); //output --> 0getVowels("AEIOU"); //output --> 5