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

Javascript: Sift through Text with Regular Expressions -- not accepting actual word pattern expression #10989

Closed
ar2pi opened this issue Sep 29, 2016 · 3 comments
Labels
help wanted Open for all. You do not need permission to work on these.

Comments

@ar2pi
Copy link

ar2pi commented Sep 29, 2016

Challenge Name

Sift through Text with Regular Expressions
https://www.freecodecamp.com/challenges/sift-through-text-with-regular-expressions

Issue Description

The instructions clearly state

Select all the occurrences of the word and in testString.

Hence i think the following regex /\band\b/gi or /(?:\b)and(?:\b)/gi where one actually considers the word boundaries in the expression should also be a valid answer, not just /and/gi.

Sorry if this a duplicate (and it probably is), but definitely should be fixed IMHO. Could turn down some dedicated beginners.

Code

var expression = /\band\b/gi;
var andCount = testString.match(expression).length;
@erictleung
Copy link
Member

@decksterr thanks for the issue. I agree that the tests should be better at allowing other regular expression patterns that solve the challenge.

@erictleung erictleung added the help wanted Open for all. You do not need permission to work on these. label Sep 29, 2016
@newyork-anthonyng
Copy link
Contributor

@erictleung If nobody else has worked on this yet, I'd like to make work on it and make a PR.

@texas2010
Copy link
Member

@newyork-anthonyng, you can work on that.

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.
Projects
None yet
Development

No branches or pull requests

5 participants