Regular Expressions - Check For Mixed Grouping of Characters

Tell us what’s happening:
Describe your issue in detail here.
could any of you give code explaination
Your code so far

let myString = "Eleanor Roosevelt";
let myRegex = /(Franklin|Eleanor) (([A-Z]\.?|[A-Z][a-z]+) )?Roosevelt/;
let result = myRegex.test(myString);
console.log(result) // 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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36

Challenge: Regular Expressions - Check For Mixed Grouping of Characters

Link to the challenge:

this code is essentially 3 lines.
I assume you understand the first and 3rd lines.
So that means you need help understanding the pattern being used?
You can use this tool to help you with that

Switch the flavor in the left hand side menu to ECMAScript and then paste the regular expression in the space provided.
This tool will help you understand the parts of the pattern and you can also test the pattern with different strings.

1 Like

you just read my mind !!! :slight_smile: :slight_smile: :slight_smile: :slight_smile:

you would be surprised what kind of questions we see here on the forum.
We prefer that people ask specific questions so that we don’t start on different pages when talking.

1 Like

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