Back to problems

Simplified Grep

Object-Oriented Programming · Bloomberg · Medium

Requirements Create a function or compact class with this interface: The operation should return the input lines in which pattern appears as a substring. The design should emphasize the following: Keep line acquisition, matching, and output formatting as separate responsibilities. Accept a flags object so additional options can be introduced later without changing existing callers. Possible options include caseInsensitive, invertMatch, lineNumbers, and wholeWord. Before…

Checking your access…