This issue extends the framework with grep shell command.
grep: The grep utility searches any given input files, selecting lines that match one or more patterns. By default, a pattern
matches an input line if the regular expression (RE) in the pattern matches the input line without its trailing newline.
An empty expression matches every line. Each input line that matches at least one of the patterns is written to the standard output.
Steps to Reproduce (if applicable)
[x] Implement support for an empty expression
[x] Match a simple one letter pattern and return the correct exit code to the shell. When a pattern is matched grep should return the exit code zero and non-zero when no pattern is matched.
[ ] #16
[ ] #17
% grep -r Nirvana * | grep -v Madonna
rockbands.txt:Nirvana
[x] support \d and \w in the search pattern. Their meanings are:
\d - a digit.
\w - a word character.
[x] Implement support for matching ^ match to the beginning of a line and $ matches to the end.
Issue Type
Please select the appropriate type of issue:
Description
This issue extends the framework with
grep
shell command.grep
: The grep utility searches any given input files, selecting lines that match one or more patterns. By default, a pattern matches an input line if the regular expression (RE) in the pattern matches the input line without its trailing newline. An empty expression matches every line. Each input line that matches at least one of the patterns is written to the standard output.Steps to Reproduce (if applicable)
[x] Implement support for an empty expression
[x] Match a simple one letter pattern and return the correct exit code to the shell. When a pattern is matched grep should return the exit code zero and non-zero when no pattern is matched.
[ ] #16
[ ] #17
[x] support \d and \w in the search pattern. Their meanings are:
\d
- a digit.\w
- a word character.[x] Implement support for matching ^ match to the beginning of a line and $ matches to the end.
[ ] #20
[ ] #18
[ ] #19
Additional Information
Reference: coding-challenges-grep-tool