Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyssacavalcanti/def48fbc638c806c40a6f81780e9976e to your computer and use it in GitHub Desktop.
Save lyssacavalcanti/def48fbc638c806c40a6f81780e9976e to your computer and use it in GitHub Desktop.
Regular Expressions - Match Single Character with Multiple Possibilities
Use a character class with vowels (a, e, i, o, u) in your regex vowelRegex to find all the vowels in the string quoteSample.
Note: Be sure to match both upper- and lowercase vowels.
Tests:
You should find all 25 vowels.
Your regex vowelRegex should use a character class.
Your regex vowelRegex should use the global flag.
Your regex vowelRegex should use the case insensitive flag.
Your regex should not match any consonants.
________________________________________________
let quoteSample = "Beware of bugs in the above code; I have only proved it correct, not tried it.";
let vowelRegex = /[aeiou]/gi;
let result = quoteSample.match(vowelRegex);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment