I was making a regExp with the condition of the title: Word that begins and ends in a vowel and both are the same, I have this regExp:
let re = new RegExp('^[aeiou]*?=$[aeiou]');
The letters between the first and last (if any) do not matter if they are consonants.
It doesn't work, I don't know what I might be missing, this string abcda
doesn't accept it and it should be valid...
There may be a more elegant solution but you can use the following regular expression:
^([aeiou])[a-z]*\1$
What this regular expression does is capture with
([aeiou])
a group which is then passed as a reference in\1