Skip to content
/ mygrep-go Public

A small implementation of grep, inspired by rhaeguard's 'How to Build a Regex Engine from Scratch' and CodeCrafters's 'Build Your Own grep'

License

Notifications You must be signed in to change notification settings

miy4/mygrep-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mygrep-go

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.

Features

  • 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)

Getting Started

To get started with mygrep-go, follow these steps:

  1. Clone the repository: git clone https://github.com/miy4/mygrep-go.git
  2. Build the application: go build ./cmd/mygrep
  3. Run the application: ./mygrep pattern file

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Acknowledgement

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.

About

A small implementation of grep, inspired by rhaeguard's 'How to Build a Regex Engine from Scratch' and CodeCrafters's 'Build Your Own grep'

Resources

License

Stars

Watchers

Forks

Languages