This repository contains a CLI application that implements a part of the grep
command. It has been heavily influenced by the grep track on codecrafters.io.
- CLI interface for searching patterns in files/stdin
- Tiny implementation of support for regular expressions
- Start/end of string anchor:
^
,$
- Quantifier:
+
,*
,?
- Wildcard:
.
- Meta characters:
\d
,\w
- Positive/negative character group:
[abc]
,[^abc]
- Alternation:
(abc|def)
- Start/end of string anchor:
To get started with mygrep-go, follow these steps:
- Clone the repository:
git clone https://github.com/miy4/mygrep-go.git
- Build the application:
go build ./cmd/mygrep
- Run the application:
./mygrep pattern file
This project is licensed under the MIT License. See the LICENSE file for more details.
I would like to acknowledge the following resources that have been instrumental in the development of this project:
- The grep track on codecrafters.io: This track provided valuable guidance and inspiration for implementing the
grep
functionality in this CLI application. - The article by rhaeguard: It was a great reference for understanding regular expressions and implementing support for them in this project.