Chapter 3 : Lab - $group and Accumulators

The question is

For all films that won at least 1 Oscar, calculate the standard deviation, highest, lowest, and average imdb.rating. Use the sample standard deviation expression.

But why should we use “Oscars” instead of Oscar ?

awards: /Won \d{1,2} Oscars?/

According to the question, shouldn’t the match stage be

awards: /Won \d{1,2} Oscar?/
?

Because we have to match Won 1 Oscar and Won 2 Oscars. That is sometimes with an s and some other times without the s. That is the reason of the question mark. With r? rather than s? you would also match Won 1 Oscam. Probably, not in this data set.

2 Likes

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