Tell us what’s happening:
Regular Expressions: Check For Mixed Grouping of Characters
The answer for the question is:
let myRegex = /(Franklin|Eleanor).*Roosevelt/;
Wouldn’t a better answer be the below to account for the spacing? Otherwise even “EleanorRoosevelt” would be accepted as True.
let myRegex = /(Franklin|Eleanor)\s(.*)Roosevelt/;
Your code so far
let myString = "Eleanor Roosevelt";
let myRegex = /(Franklin|Eleanor).*Roosevelt/;
let result = myRegex.test(myString);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
.
Challenge: Check For Mixed Grouping of Characters
Link to the challenge: