Confusing requirements to pass challenge _Regular Expressions: Match Characters that Occur Zero or More Times_ (originally reported in this forum thread). The confusion results from lack of explanation in the challenge body, as well as the fact that an optimal answer wouldn't use the target syntax at all.
_Regular Expressions: Match Characters that Occur Zero or More Times_
I can see what you mean. I do feel that after careful reading the problem statement isn't too confusing.
Someone could miss the fact that they're asking for both "upper and lower "a" characters in chewieQuote." If not, they might be tempted to use a bracket operator [aA]
.
Reading over the examples, this one let goRegex = /go*/;
is very close to the actual solution.
Maybe a simple addition of wording would help:
"Create a regex chewieRegex that uses the * character to match all the upper and lower "a" characters in chewieQuote (both "A" and "a" characters). Your regex does not need flags, and it should not match any of the other quotes."
hey @lionel-rowe i had also wanted to solve this challenge, after 2 days i have found the answer but it was too simple so we have messed up, i have confused because of this line in explanation
"Your regex does not need flags, and it should not match any of the other quotes." .
you wont believe what the solution is, it is so simple here it is: /Aa*/
in life also sometimes we think challenges are so harder to solve but it is not, answer is so simple like here.
Here's why I think it's confusing:
"a"
characters in chewieQuote
. Your regex does not need flags, and it should not match any of the other quotes.""a"
characters (case insensitive). It should not match when there is only 1 consecutive "a"
."/a{2,}/i
, or perhaps /aa+/i
. However, the challenge instead requires /aaa*/i
. This fails to demonstrate how the *
character is useful.I realized that this is actually the wrong repo for this, so I'll open a new issue for it in /curriculum.
@lionel-rowe, you should re-open this issue here.
I agree that the instructions here are vague. It seems to me that the desired solutions is /Aa*/
so the instructions should probably read:
Create a regex, chewieRegex, that uses the
*
character to match the first uppercase "A" character followed by any number of lowercase "a" characters in chewieQuote. Your regex should not use any flags, and it should not match any of the other quotes.
A test should probably also be added that checks that no flags were used.
@MattYamamoto This challenge was updated recently but has not been deployed to production yet. You can take a look at the new version on our beta site.
If you feel the newer version is lacking, please open a separate issue, so it can be discussed further.
Thank you.
@RandellDawson the site is offline
Most helpful comment
hey @lionel-rowe i had also wanted to solve this challenge, after 2 days i have found the answer but it was too simple so we have messed up, i have confused because of this line in explanation
you wont believe what the solution is, it is so simple here it is: /Aa*/
in life also sometimes we think challenges are so harder to solve but it is not, answer is so simple like here.