FAQ: Introduction to Regular Expressions - Grouping

This community-built FAQ covers the “Grouping” exercise from the lesson “Introduction to Regular Expressions”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Practical Data Cleaning

FAQs on the exercise Grouping

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Can anyone help?

In PHP Form Validation - Introduction to Regular Expressions - Groupings - Page 8 I am getting the correct regex, but the key is not appearing in the browser, and so I am no able to move on in this exercise, as I’m missing this particular key.

I’ll include a screenshot in case I’m missing something blatantly obvious…
Thanks

Try entering:

(puppies|kitty cats) are my favorite!

Once you do that, the hidden key will appear.

(When you start typing the above expression, the green character matches will probably not light up until you close the parentheses).

1 Like

Thank you for your reply. :slight_smile:

As you can see from my screenshot, the issue was not getting the correct side to light up green. The problem I had was that the key was not appearing at all. Even when I lit them all up in green, and no matter how I achieved it. I ended up reporting it as a bug as I tried numerous ways of lighting them up green, with no key appearing at any time.

It may well be that the system is checking your proposed solution against some strings which are not being shown on screen.

Your proposed solution will match the strings "puppies are my favorite!" and "kitty cats are my favorite!", but it will also match the strings "monkeys are my favorite!" and "black bars are my favorite!". It is possible that behind the scenes, the system is checking whether your proposed solution successfully matches the specified strings and doesn’t match ALL other strings.

It showed the hidden key when I typed the following: