Regular Expressions - Check For Mixed Grouping of Characters

Tell us what’s happening:
Hello Everyone,

I am new to coding, and I am trying to solve this line of code that is mentioned below and every time I run the code it tells me that my result should return true. I am very much stuck now and have tried different solutions for my problem. Can anybody help me and let me know what I am doing wrong with a brief explanation. So that I may be able to write the correct code.

Thank you, I appreciate everyone’s time.

Your code so far

let myString = "Eleanor Roosevelt";
let myRegex = /^(Franklin|Eleanor) [A-Z]\.? Roosevelt$/; // Change this line (I have tried it with different solutions)
myRegex.test(myString); // 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/111.0.0.0 Safari/537.36 Edg/111.0.1661.51

Challenge: Regular Expressions - Check For Mixed Grouping of Characters

Link to the challenge:

It matches a space followed by an uppercase letter. I think.

@camperextraordinaire I also tried the following code I still am getting the same error as mentioned in the post.
let myString = “Eleanor Roosevelt”;
let myRegex = /(Franklin|Eleanor)( [A-Za-z].?)* Roosevelt/;(there is a \ added before the . ) It is not being dispalyed for some reason.
myRegex.test(myString);

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