Regular Expressions - Extract Matches

Tell us what’s happening:
I don’t think description of this topic is correct. match method doesn’t only return [“Hello”], [“expressions”] but in the array there is also index, input, groups.

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Regular Expressions - Extract Matches

Link to the challenge:

just curious, what would you call this topic if you had the ability to make it change?

I don’t have a problem with title of this topic, but description inside I feel like is wrong.

I think your concern doesn’t apply as the exercise is trying to explain how to use match in a limited educational setting. FCC is not attempting to recreate the documentation for how match works in full. You will find this is the case for other methods taught as well.

I didn’t come across similar issue before, but if it’s not uncommon. At least message that I should double check with official documentation, because info provided in descriptions of the challenges is not correct or complete would be appreciated.

“Not correct” in what way?

Okay let me try again.

this is example given by FCC and description what it does:

"Hello, World!".match(/Hello/);
let ourStr = "Regular expressions";
let ourRegex = /expressions/;

Here the first match would return ["Hello"] and the second would return ["expressions"].

But this is what it actually does:

you are understanding the words too literally. The sentence “…the first match would return” is not incorrect. It is just not -comprehensive-.

You are free to discuss this further with the fCC maintainers if you wish but from my personal reading of this, it is perfectly -correct-.

ps. to discuss further you can open an issue in the fCC repo in Github

Click here to open an issue GitHub Issues.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.