Given a string arg, count the vowels and return the number.
package countvowels import "regexp" // CountVowels should have a comment documenting it. func CountVowels(arg string) int { return len(regexp.MustCompile(`[^aeiouAEIOU]`).ReplaceAllString(arg, "")) }
class CountVowels { Integer run(String inputString) { return inputString.replaceAll("[^aeiouAEIOU]", "").length(); } }
const run = (arg) => arg.replace(/[^aeiou]/gi, '').length;
<?php function countVowels($str) { return strlen(preg_replace("/[^aeiou]/i", "", $str)); }
import re def run(src): return len(re.sub("[^aeiouAEUIO]", "", src))
class CountVowels def self.count(input) flt = input.gsub(/[^aeiou]/i, '') return flt.length end end
extern crate regex; use regex::Regex; pub fn count_vowels(s: String) -> usize { return Regex::new("[^aeiouAEIOU]").unwrap().replace_all(&s, "").len(); }