Problem 221 - Sift through Text with Regular Expressions

Problem 221 - Sift through Text with Regular Expressions
0

#1

Hi all,
Maybe I am being just too thick at this moment, but I am not understanding Problem 221 - ‘Sift through Text with Regular Expressions.’ I am totally at a loss for what they are asking for. I am not even sure where to begin… :frowning:

I know this sounds a little off but could someone spell out the answer or re-word the question so that I may better understand. I am not usually so thick. :slight_smile:

ALSO, I have thought of an added function that FCC could do. FCC could add a button to alert the programmers that a question is not clear, so that they may track ‘problem’ questions and consider re-wording them in future additions.

Cheers,
M


#2

The only line of code you have to modify is:

var expression = /./gi;  // Change this Line

The second sentence in the instructions tell you exactly what to do:

Select all the occurrences of the word and in testString.

You can do this by replacing the . part of the regular expression with the word and.

Just replace the . with the word and


#3

Interesting, I was adding ‘and+’ which was throwing me off. I must have read too much into the question by adding the ‘+’.

Thanks,
‘Light dawns on Marble Head’ ;))