Displaying 1 result from an estimated 1 matches for "mrhdlttllmb".
Did you mean:
mryhdlttllmb
2008 Feb 03
4
Extract vowels and consonants using Ruby Regex
..."Mary had a little lamb".consonants
=> mryhdlttllmb
However, the regex does not accommodate the conditional treatment of
''y'' as a vowel *if there is no other vowel before or after it.* If
properly implemented, the previous examples would return: ayaaiea
(vowels) and mrhdlttllmb (consonants).
According to this post (http://www.perlmonks.org/?node_id=592867),
this could be accommodated in Perl using "zero-width negative-look-
behind" and "zero-width negative-look-ahead" assertions as follows:
my @vowels = ( /[aeiou]|(?<![aeiou])y(?![aeiou])/gi );
W...