{"id":18591901,"url":"https://github.com/maolonglong/redglob","last_synced_at":"2025-04-10T15:31:51.485Z","repository":{"id":166697223,"uuid":"641921951","full_name":"maolonglong/redglob","owner":"maolonglong","description":"🐹 redglob is a simple glob-style pattern matcher library for Go, inspired by Redis's pattern matching implementation.","archived":false,"fork":false,"pushed_at":"2025-03-24T19:53:37.000Z","size":43,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T23:41:18.523Z","etag":null,"topics":["glob","go","golang","match","pattern-matching","unicode"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maolonglong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-05-17T12:52:14.000Z","updated_at":"2024-12-07T07:45:42.000Z","dependencies_parsed_at":"2023-12-13T06:28:37.869Z","dependency_job_id":"14fffc97-c0c2-482b-82af-eb8d2b7c4a3b","html_url":"https://github.com/maolonglong/redglob","commit_stats":null,"previous_names":["maolonglong/redglob"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maolonglong%2Fredglob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maolonglong%2Fredglob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maolonglong%2Fredglob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maolonglong%2Fredglob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maolonglong","download_url":"https://codeload.github.com/maolonglong/redglob/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248243465,"owners_count":21071054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["glob","go","golang","match","pattern-matching","unicode"],"created_at":"2024-11-07T01:05:33.685Z","updated_at":"2025-04-10T15:31:51.174Z","avatar_url":"https://github.com/maolonglong.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redglob\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/maolonglong/redglob)](https://pkg.go.dev/github.com/maolonglong/redglob)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/maolonglong/redglob/go.yml?label=ci)](https://github.com/maolonglong/redglob/actions/workflows/go.yml)\n[![Codecov](https://img.shields.io/codecov/c/github/maolonglong/redglob/main?logo=codecov)](https://codecov.io/gh/maolonglong/redglob)\n[![GoReportCard](https://goreportcard.com/badge/github.com/maolonglong/redglob)](https://goreportcard.com/report/github.com/maolonglong/redglob)\n\nRedglob is a simple glob-style pattern matcher library for Go, inspired by Redis's pattern matching implementation. It provides a fast and easy-to-use solution for matching strings and byte slices against patterns with wildcard support.\n\n## Features\n\n- Unicode support\n- Case-insensitive matching\n- Capability to match strings and byte slices\n- Supports `*`, `?`, character classes `[abc]`, ranges `[a-z]`, and negation `[^abc]`\n\n## Installing\n\n```bash\ngo get github.com/maolonglong/redglob\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/maolonglong/redglob\"\n)\n\nfunc main() {\n\tpattern := \"h?ll*\"\n\tstr := \"hello, world!\"\n\n\tif redglob.Match(str, pattern) {\n\t\tfmt.Println(\"Match!\")\n\t} else {\n\t\tfmt.Println(\"No match.\")\n\t}\n}\n```\n\n## Functions\n\n- `Match(str, pattern string) bool`: returns true if the given string matches the pattern.\n- `MatchFold(str, pattern string) bool`: case-insensitive version of `Match`.\n- `MatchBytes(b []byte, pattern string) bool`: similar to `Match`, but accepts a byte slice instead of a string.\n- `MatchBytesFold(b []byte, pattern string) bool`: case-insensitive version of `MatchBytes`.\n\n## Syntax\n\nRedglob's pattern syntax is similar to that of Redis's `KEYS` command:\n\n- `*` matches any sequence of non-Separator characters\n- `?` matches any single non-Separator character\n- `c` matches character `c` (where `c` is any character except `*`, `?`, and `\\`)\n- `\\c` matches character `c`\n- `[abc]` matches `a` or `b` or `c`\n- `[^abc]` matches any character except `a`, `b`, or `c`\n- `[a-z]` matches `a` to `z`\n- `[^a-z]` matches any character except `a` to `z`\n\n## Performance\n\nRedglob is implemented in pure Go and is optimized for performance. It uses a simple and efficient algorithm to match patterns against strings, and takes advantage of Go's built-in Unicode support to handle Unicode characters correctly.\n\n## License\n\nRedglob is licensed under the Apache License, Version 2.0. See the [LICENSE file](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaolonglong%2Fredglob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaolonglong%2Fredglob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaolonglong%2Fredglob/lists"}