Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[beta] Improve Instruction for "Regular Expressions: Match Single Character with Multiple Possibilities" #13044

Closed
Greenheart opened this issue Feb 1, 2017 · 3 comments
Labels
help wanted Open for all. You do not need permission to work on these. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory.

Comments

@Greenheart
Copy link
Member

Challenge match-single-character-with-multiple-possibilities has an issue.
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36.

let quoteSample = "Beware of bugs in the above code; I have only proved it correct, not tried it.";
let vowelRegex = /[aeiou]/ig; // Change this line
let result = quoteSample.match(vowelRegex); // Change this line

This challenge asks me to "count the number of vowels". This made me think I should add .length to the expression evaluating to my result variable. Adding .length fails the tests, while leaving it out lets me complete the challenge.

Since the challenge isn't testing for a numerical value in the result variable, I suggest that we change the instruction and first test case to only ask campers to find all vowels.

To fix this, update the final sentence to

...to find all vowels in the string quoteSample.

and update the message of the first test case:
assert(result.length == 25, 'message: You should find all 25 vowels.);

@Greenheart Greenheart added the scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. label Feb 1, 2017
@erictleung
Copy link
Member

erictleung commented Feb 2, 2017

@Greenheart ah I must have been a little lazy to mislead people in the instructions 😆 This change sounds good to me 👍

@erictleung erictleung added the help wanted Open for all. You do not need permission to work on these. label Feb 2, 2017
@Greenheart
Copy link
Member Author

@erictleung It happens to the best of us! 😉

@Manish-Giri
Copy link
Contributor

I'll do this too, since the change sounds similar to the other two..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory.
Projects
None yet
Development

No branches or pull requests

3 participants