2019-01-18 02:38:46 +05:30
|
|
|
---
|
|
|
|
title: Check For Mixed Grouping of Characters
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Check For Mixed Grouping of Characters
|
2019-01-18 02:38:46 +05:30
|
|
|
|
|
|
|
### Hint 1
|
|
|
|
|
|
|
|
Use `a|b` to check for either `a` or `b`.
|
|
|
|
|
|
|
|
### Hint 2
|
|
|
|
|
|
|
|
Your regex should use mixed grouping like `/P(engu|umpk)in/g`.
|
|
|
|
|
|
|
|
### Hint 3
|
|
|
|
|
|
|
|
Use `.*` to allow for middle names.
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
---
|
|
|
|
## Solutions
|
2019-01-18 02:38:46 +05:30
|
|
|
|
|
|
|
```javascript
|
|
|
|
let myString = "Eleanor Roosevelt";
|
|
|
|
let myRegex = /(Franklin|Eleanor).*Roosevelt/;
|
|
|
|
let result = myRegex.test(myString);
|
|
|
|
```
|