feat(curriculum): add grouping characters challenge and guide (#34875)

Added new challenge for mixed grouping of characters
This commit is contained in:
The Coding Aviator
2019-01-18 02:38:46 +05:30
committed by Jaka Kranjc
parent e1be160a65
commit ca2d01a81c
3 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,24 @@
---
title: Check For Mixed Grouping of Characters
---
## Check For Mixed Grouping of Characters
### 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.
### Solution
```javascript
let myString = "Eleanor Roosevelt";
let myRegex = /(Franklin|Eleanor).*Roosevelt/;
let result = myRegex.test(myString);
```