Welcome to another challenge in which we will use regex101.com to find patterns in text. If this is your first exercise, please check the first edition - you will find instructions there.
Task 1:
“The catastrophic novel entitled”“The Enigmatic Catalyst” features Osmund Blackcat and a talking cat"
Find the word “cat” in the following sentence. Skip the phrases that contain such a component.
The tricky bit here was in Tasks 2 and 3 when ensuring to capture strings potentially separated by AND or OR and looking for the keywords library or libraries and parameter and parameters rather than literals. Those could be extended with commas to capture lists of 3 or more. I didn’t go back and remove the delimiters.
Task 2
In this case, I start by establishing that the operators are not case-sensitive. I then state that both before and after the “cat” component there must be letters - any number
Task 3
Again, I specify that the case does not matter. Then I determine that we are dealing with a closed from the right word “color” with an optional (?) letter “u” in the middle.
In this assignment, I return to the concept of word boundaries. It must start with the component “for”, but the letter “r” must occur at least 2 times. After that, there are any number of letters
Hi @HufferD , thank you for answers. I found it very interesting to create some kind of challange for solutions by adding components that reveals potential problems with expressions. I think it will be interesting to explore unit testing functionality of regex101.com