How do I test if a string contains two or more vowels?
I have the following code, but it only tests 2 vowels adjacent to each other. I just want to know if the string contains two or more vowels regardless of where they appear in the string.
if /[aeiouy]{2,}/.match(word)
puts word
end
You could use
scanwhich returns an array with all the matches: