2018-10-12 15:37:13 -04:00
---
title: Match Single Character with Multiple Possibilities
---
2019-07-24 00:59:27 -07:00
# Match Single Character with Multiple Possibilities
2018-10-12 15:37:13 -04:00
2019-07-24 00:59:27 -07:00
---
## Problem Explanation
2018-10-12 15:37:13 -04:00
Using the match() method, you can extract parts of a string that match with your regular expression. In this challenge, you are extracting the vowels "a, e, i, o, u" from a provided string.
2019-07-24 00:59:27 -07:00
---
## Hints
### Hint 1
2018-10-12 15:37:13 -04:00
Are you attempting to use the test() method? Remember this method only returns True or False -- we need to extract the vowels from the string.
2019-07-24 00:59:27 -07:00
### Hint 2
2018-10-12 15:37:13 -04:00
Have you tried using the '[]' character case match without commas? i.e. [abcd] vs [a, b, c, d]
2019-07-24 00:59:27 -07:00
---
## Solutions
< details > < summary > Solution 1 (Click to Show/Hide)< / summary >
2018-10-12 15:37:13 -04:00
```javascript
2019-07-24 00:59:27 -07:00
let quoteSample =
"Beware of bugs in the above code; I have only proved it correct, not tried it.";
let vowelRegex = /[aeiou]/gi; // Change this line
2018-10-12 15:37:13 -04:00
let result = quoteSample.match(vowelRegex); // Change this line
```
2019-07-24 00:59:27 -07:00
< / details >