let myString = "Eleanor Roosevelt";
let myRegex = /(Franklin|Eleanor)? Roosevelt/; // Change this line
let result = myString.test(myRegex); // Change this line
// After passing the challenge experiment with myString and see how the grouping works
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36.
One suggestion for starters would be to change the last line of code so that it properly tests your regex. Your order is a bit different. It should be:
let result = myRegex.test(myString);
After changing this line, it should pass most of the tests.
The only test it will not past is the “Franklin D. Roosevelt” one. For this one, you need another set of rules like the ones you mention in the first parentheses (Franklin|Eleanor). Try to think of how to write for your regex to search for a space or any other character in between the two names.