I have a problem with regex. I want to combine only these words, containing only vowels or consonants.
For example, I have lines like this:
aeyiuo
aeYYuo
qrcbk
aeeeee
normal
Text
extTT
My regular expression should match: aeyiuo aeYYuo aeeeee
I don’t know why my expression doesn’t work. ^[aeyiuo]*|[^aeyiuo]*$
To test my regular expression, I use online parsers: http://www.regexr.com/ or http://regexpal.com/
If someone can explain my mistake to me, I would be very grateful.
source
share