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

Comments

@Greenheart
Copy link
Member

@Greenheart Greenheart commented Feb 1, 2017

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.);

@erictleung
Copy link
Member

@erictleung 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 👍

@Greenheart
Copy link
Member Author

@Greenheart Greenheart commented Feb 2, 2017

@erictleung It happens to the best of us! 😉

@Manish-Giri
Copy link
Contributor

@Manish-Giri Manish-Giri commented Feb 2, 2017

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants