Learn Functional Programming by Building a Spreadsheet - Step 36

Tell us what’s happening:

Please assist. i incorporated everything the step requires, but my code still doesnt pass. it requires a capture group, character class and a character class to amtch A through J

Your code so far

const rangeRegex = /^(A|B|C|D|E|F|G|H|I|J)$/;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

Learn Functional Programming by Building a Spreadsheet - Step 36

“Use a capture group with a character class to achieve this.”

You did use a capture group, but you didn’t use a character class.

P.S. Don’t add the ^ and $ anchors.

so if i remove the anchors, it would work? my capture group is enclosed in parentheses containing a character class . I still dont quite understand

Yes, you need to remove the anchors, but that’s not the only thing that needs to be fixed.

Yes, you are using a capture group with the parentheses, but you aren’t using a character class. I’m assuming that character classes have already been introduced in the FCC curriculum, but I don’t know it well enough to point you to the exact step, so I’ll point you to this MDN article on character classes instead.

Mod edit: removed solution

@kashish.0.mittal

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.