Content bug in the challenge "Match Whitespaces" in the path"JavaScript Algorithms and Data Structures" in the "Regular Expressions" section

In this lesson you can read: “You can search for whitespace using \s , which is a lowercase s . This pattern not only matches whitespace, but also carriage return, tab, form feed, and new line characters. You can think of it as similar to the character class [ \r\t\f\n\v] .”

The problem is that if I’m not wrong nor the character class [ \r\t\f\n\v], neither the singular selectors have been introduced till to this point.

Please include a link to the challenge.

1 Like

This is the link:

Character classes were introduced in this previous lesson:

Whitespace characters were covered here:

@JeremyLT I see you are a leader and I’m new here, so I don’t understand exactly the logic you use to build the course. But I sincerely don’t understand your answer. Can you please point out where [ \r\t\f\n\v] was introduced in the two lessons you cite?

I’m fine to tell to the people: go out and find yourself what [ \r\t\f\n\v] means. But if you explain A [\s] with B [ \r\t\f\n\v] without having introduced the meaning of B, this is not helpful and gives the student the impression to have missed something.

The two parts of that charcter class were covered in two separate lessons. By this point in the curriculum we want users to synthesize previous material.

The structure in the first, the symbols in the second. Not all of them - that’s true - but it’s assumed learners realise the courses are not covering every last piece of information.
Because it’s impossible to teach EVERYTHING and it’s pointless to include a “there is more” on every single page.

I’ll answer for the last time, cause we don’t understand each other, and it’s not a big deal even.

@JeremyLT as far I understand the meaning of [ \r\t\f\n\v] and/or of the single parts of this expression (i.e. [ \r] , [\t], [\f], [\n], [\v]) are not explained anywhere. And in this sense a student (the user) can’t make an inference from that. I suppose that they are not explained anywhere since I asked you to point out where they are explained and nothing came. And it seems to me you know your stuff. In this sense is not possible to synthesize previous material you don’t have. It’s possible to go ‘outside’ and find the missing pieces and apply them on the basis of the principles you learned.

It’s pity I’ve to repeat myself. But if you as a teacher gives to the student the impression he already had to know certain information - the specific meaning of [ \r] , [\t], [\f], [\n], [\v] - cause you used them to explain something else, you just put the student in a wtf-state-of-mind or in a where-I-missed-it-state-of-mind.

Answering to @Jagaya I’m not assuming that the students are assuming that they will get every single piece of information, but the student will assume, that they should have already got a certain piece of information if you write in a way that supposes that they already got this piece of information.

I’m not saying that you have to explain the meaning of [ \r\t\f\n\v], I’m just saying that this single sentence " You can think of it as similar to the character class `[ \r\t\f\n\v]" simply makes no sense. You can give to the students the challenge to replicate [\s] without using it, but explain something with something else you didn’t explain it’s just meaningless. It’s a bug. But sure: you can sell it as a feature. :slight_smile:

This is simply false. All of the pieces of this expression have been explained in previous lessons.

I showed you where the parts of this expression were explained.

The meaning of a character class is explained right here:


Character classes allow you to define a group of characters you wish to match by placing them inside square ( [ and ] ) brackets.

That lesson comes before the lesson you linked. Did you do this lesson? Do you understand this lesson? Do you have questions about this lesson?

The meaning of escaped whitespace characters such as the newline character is explained right here:


Code Output
\' single quote
\" double quote
\\ backslash
\n newline
\r carriage return
\t tab
\b word boundary
\f form feed

That lesson also comes before the lesson you linked. Did you do this lesson? Do you understand this lesson? Do you have questions about this lesson?

Taken together, this means that [ \r\t\f\n\v] is a a group of characters that we wish to match consisting of ‘ ’ (space), \r (carriage return), \t (tab), \f (form feed), \n (newline), and \v (vertical tab, not mentioned above, but also not super common).

I’m not understanding what you are confused about. Do you not understand character classes? Do you not understand escape sequences for whitespace characters? Is there something else that you don’t understand?


Sorry for my inattention. :pray:

Feel free to delete the thread.

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