I have no clue how to solve this one?
Posted: Tue Apr 07, 2009 8:18 pm
Hello
I have been trying to solve a school regular expression for hours now. The problem is that i should find all words beginning with a Vowel and ending with a Vowel and then the restriction is that only one consonant is allowed in the middle otherwise anything goes. This is what I came up with
"^[aeiouAEIOU'\.]\{1,\}[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]\{1,1\}[aeiouAEIOU'\.]\{1,\}$"
the problem with it is that it can catch the word U.S.A or i've. Been sitting for hours trying to figure this out.
All help is welcome.
I have been trying to solve a school regular expression for hours now. The problem is that i should find all words beginning with a Vowel and ending with a Vowel and then the restriction is that only one consonant is allowed in the middle otherwise anything goes. This is what I came up with
"^[aeiouAEIOU'\.]\{1,\}[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]\{1,1\}[aeiouAEIOU'\.]\{1,\}$"
the problem with it is that it can catch the word U.S.A or i've. Been sitting for hours trying to figure this out.
All help is welcome.