...Which leans pretty heavy on using various bits of javascript: strings are technically arrays, so if $var is "zebra", then $var[0] is 'z', and this checks to see if that first letter is inside a string of vowels. Sorry, 'y' isn't supported :V
This is actually more false than it is true. String.prototype.indexOf and Array.prototype.indexOf are entirely different functions with similar names. And any object can be indexed in an array-like fashion:
({})[2] = "Red";
{ 2: "Red" }
Strings are internally implemented as objects with numeric properties and a "magic" length property, but that's a far cry from an actual Array.
Comments
I laughed. I meant to answer this question earlier, but I got totally sidetracked. This is the way to do it though.
To handle the "and sometimes Y" case: