{"id":22361336,"url":"https://github.com/kei-k23/g-grep","last_synced_at":"2026-03-07T19:32:24.251Z","repository":{"id":255195431,"uuid":"848824956","full_name":"Kei-K23/g-grep","owner":"Kei-K23","description":"G-grep is a small regular expression (regex) engine that is written in Go","archived":false,"fork":false,"pushed_at":"2024-08-28T13:44:04.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-15T03:00:16.494Z","etag":null,"topics":["go","regex","regular-expression"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kei-K23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T13:27:41.000Z","updated_at":"2024-09-18T01:06:22.000Z","dependencies_parsed_at":"2024-08-28T20:31:41.375Z","dependency_job_id":null,"html_url":"https://github.com/Kei-K23/g-grep","commit_stats":null,"previous_names":["kei-k23/g-grep"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kei-K23/g-grep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Fg-grep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Fg-grep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Fg-grep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Fg-grep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kei-K23","download_url":"https://codeload.github.com/Kei-K23/g-grep/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Fg-grep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30227851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","regex","regular-expression"],"created_at":"2024-12-04T16:29:20.353Z","updated_at":"2026-03-07T19:32:24.229Z","avatar_url":"https://github.com/Kei-K23.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `G-Grep` - A Custom grep -E Implementation in Go\n\n## Overview\n\n`G-Grep` is a custom implementation of the grep -E command in `Go`. It reads input from stdin and matches it against a specified pattern, returning success (exit code 0) if a match is found, and failure (exit code 1) otherwise. This program supports some basic regular expression features, including `^, $, ?, +, ., character classes ([]), and backreferences`.\n\n## Features\n\n`Pattern Matching`: Matches lines based on the provided pattern.\n`Anchors`: Supports ^ (beginning of line) and $ (end of line).\n`Character Classes`: Supports character classes with negation ([^]).\n`Quantifiers`: Supports ? (zero or one), + (one or more), and . (any single character).\n`Backreferences`: Supports backreferences like \\1.\n`Escape Sequences`: Supports \\d (digits) and \\w (word characters).\n\n## Usage\n\n```bash\necho \u003cinput_text\u003e | ./g-grep -E \u003cpattern\u003e\n```\n\n### Examples\n\n1. Match any line containing the word \"Go\":\n\n```bash\necho \"I love Go programming\" | ./g-grep -E \"Go\"\n```\n\n2. Match lines that start with \"Hello\":\n\n```bash\necho \"Hello, World!\" | ./g-grep -E \"^Hello\"\n```\n\n3. Match lines that end with \"end\":\n\n```bash\necho \"This is the end\" | ./g-grep -E \"end$\"\n```\n\n4. Match lines with a digit:\n\n```bash\necho \"The year is 2024\" | ./g-grep -E \"\\d\"\n```\n\n5. Match lines with a word character:```\n\n```bash\necho \"This_is_a_word\" | ./g-grep -E \"\\w\"\n```\n\n6. Match lines with an optional character (zero or one occurrence):\n\n```bash\necho \"color\" | ./g-grep -E \"colou?r\"\n```\n\n7. Match lines with one or more occurrences of a character:\n\n```bash\necho \"aaa\" | ./g-grep -E \"a+\"\n```\n\n8. Match lines using a backreference:\n\n```bash\necho \"abcabc\" | ./g-grep -E \"(abc)\\1\"\n```\n\n### Exit Codes\n\n- 0: A match was found.\n- 1: No match was found.\n- 2: An error occurred (e.g., incorrect usage or pattern syntax).\n\n## Installation\n\nEnsure you have Go installed on your system.\n\n1. Clone this repository:\n\n```bash\ngit clone https://github.com/yourusername/g-grep.git\n```\n\n2. Build the program:\n\n```bash\ncd g-grep\ngo build -o g-grep\n```\n\n## Contributing\n\nFeel free to contribute to this project by opening issues, suggesting features, or submitting pull requests.\n\n## Acknowledgments\n\nThis project is inspired by the grep -E command and aims to provide a basic understanding of pattern matching and regular expressions in `Go`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkei-k23%2Fg-grep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkei-k23%2Fg-grep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkei-k23%2Fg-grep/lists"}