Check For Mixed Grouping of Characters

I’m asking this question for interest.
Is it possible to somehow alter this expression so that instead of (Franklin|Eleanor), you can substitute any combination of letters?


let myString = "Eleanor Roosevelt";
let myRegex = /(Franklin|Eleanor).*Roosevelt/; // Change this line
let result = myRegex.test(myString); // Change this line
// After passing the challenge experiment with myString and see how the grouping works

Challenge: Check For Mixed Grouping of Characters

Link to the challenge:

you could probably do [a-zA-Z]+ or \w+

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.