Check out example codes for "match a string that starts and ends with the same vowel". It will help you in understanding the concepts better.

Code Example 1

const regex = /\b(?<vowel>[aeiou])(\w*\k<vowel>)?\b/

Learn ReactJs, React Native from akashmittal.com