{"id":22361332,"url":"https://github.com/kei-k23/rex","last_synced_at":"2025-10-15T00:31:52.392Z","repository":{"id":255298141,"uuid":"849147649","full_name":"Kei-K23/rex","owner":"Kei-K23","description":"Regular Expression (Regex) engine that written in C++","archived":false,"fork":false,"pushed_at":"2024-08-30T06:32:18.000Z","size":67,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-04T16:39:21.087Z","etag":null,"topics":["clang","cpp","regex","regular-expression"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"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":"2024-08-29T04:14:04.000Z","updated_at":"2024-09-18T01:06:22.000Z","dependencies_parsed_at":"2024-12-04T16:34:27.668Z","dependency_job_id":"f77b3d7b-f4b6-46d3-a1fc-5a256fff38fe","html_url":"https://github.com/Kei-K23/rex","commit_stats":null,"previous_names":["kei-k23/rex"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Frex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Frex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Frex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Frex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kei-K23","download_url":"https://codeload.github.com/Kei-K23/rex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236541937,"owners_count":19165764,"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":["clang","cpp","regex","regular-expression"],"created_at":"2024-12-04T16:29:20.160Z","updated_at":"2025-10-15T00:31:47.095Z","avatar_url":"https://github.com/Kei-K23.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rex\n\n`Rex` is a `Regular Expression (Regex) engine` that written in `C++`. It supports basic features like matching literal characters, the wildcard (.) character, the Kleene star (\\*) for zero or more repetitions, grouping using parentheses (()), lookahead/lookbehind ,and alternation using the pipe (|) operator.\n\n## Features\n\n- **Literal Matching**: Match specific characters in the input string.\n- **Wildcard (.)**: Matches any single character.\n- **Kleene Star (\\_)**: Matches zero or more occurrences of the preceding element.\n- **Grouping (())**: Groups expressions to apply operators like \\_ or to create sub-expressions.\n- **Alternation (|)**: Provides a choice between alternatives, matching either expression.\n- **lookahead/lookbehind**: Lookaround assertions are non-capturing groups that return matches only if the target string is followed or preceded by a particular character.\n\n## Usage\n\n### Prerequisites\n\n- C++ compiler (e.g., g++, clang++).\n\n### Building the Project\n\nTo compile the project, run the following command:\n\n```bash\nclang++ -std=c++20 main.cpp -o rex\n# Or\ng++ -std=c++20 main.cpp -o rex\n```\n\n### Running the Program\n\nYou can run the compiled executable with a pattern and text input:\n\n```bash\n./regex_engine -p \u003cpattern\u003e -t \u003ctext\u003e\n```\n\n#### Example\n\nTo match the text \"bbc\" against the pattern \"a|b\\*\":\n\n```bash\n./regex_engine -p \"a|b\\*\" -t \"bbc\"\n```\n\nThis will output:\n\n```bash\nMatch!\n```\n\n### Command-Line Arguments\n\n- `-p \u003cpattern\u003e`: The regular expression pattern to match.\n- `-t \u003ctext\u003e`: The text to be matched against the pattern.\n\n### Example Patterns\n\n1. `a*b` matches `\"ab\"`, `\"aab\"`, `\"b\"`.\n2. `a|b` matches `\"a\"` or `\"b\"`.\n3. `(ab)*` matches `\"ab\"`, `\"abab\"`, `\"\"` (empty string).\n4. `a.b` matches `\"acb`\", `\"aab\"`, `\"a*b\"` (where \\* represents any character).\n\n## Project Structure\n\n- `main.cpp`: The main implementation file that includes the Lexer, Parser, AST nodes, and Matcher.\n\n### Limitations\n\n- The engine currently supports basic regular expression features and does not handle advanced features like character classes, quantifiers other than \\*, or non-greedy matching.\n\n## Future Enhancements\n\n- Add support for character classes (e.g., [a-z]).\n- Implement additional quantifiers (+, ?, {min,max}).\n- Support for anchors (^, $).\n- Enhance the engine to support non-greedy matching.\n- Add error handling and more informative messages for invalid patterns.\n\n## License\n\nThis project is licensed under the [MIT License](/LICENSE). See the LICENSE file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkei-k23%2Frex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkei-k23%2Frex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkei-k23%2Frex/lists"}