{"id":18528266,"url":"https://github.com/gsingh93/regex-parser","last_synced_at":"2025-10-17T23:01:33.893Z","repository":{"id":28518800,"uuid":"32035524","full_name":"gsingh93/regex-parser","owner":"gsingh93","description":"A recursive descent parser for basic regular expressions in Rust","archived":false,"fork":false,"pushed_at":"2015-03-19T23:02:57.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-04T22:07:48.417Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/gsingh93.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}},"created_at":"2015-03-11T18:57:57.000Z","updated_at":"2015-03-19T23:02:58.000Z","dependencies_parsed_at":"2022-08-24T07:50:26.927Z","dependency_job_id":null,"html_url":"https://github.com/gsingh93/regex-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsingh93%2Fregex-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsingh93%2Fregex-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsingh93%2Fregex-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsingh93%2Fregex-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gsingh93","download_url":"https://codeload.github.com/gsingh93/regex-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254231825,"owners_count":22036429,"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":[],"created_at":"2024-11-06T18:00:35.059Z","updated_at":"2025-10-17T23:01:28.863Z","avatar_url":"https://github.com/gsingh93.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Regex Parser\nThis is a recursive descent parser written in Rust for regular expresssions. Given a regular expression as input, it outputs an AST. It follows this very simple LL(1) grammar:\n\n```\n\u003cregex\u003e ::= \u003cterm\u003e '|' \u003cregex\u003e\n         |  \u003cterm\u003e\n\n\u003cterm\u003e ::= { \u003cfactor\u003e }\n\n\u003cfactor\u003e ::= \u003cbase\u003e { '*' }\n\n\u003cbase\u003e ::= \u003cchar\u003e\n        |  '(' \u003cregex\u003e ')'\n```\n\n## Usage\n\n```\nlet mut p = RegExParser::new(\"((a|b*)|a*)|aab\".to_string());\nlet res = Ok(Or(\n    Box::new(Sequence(vec![Box::new(Or(\n        Box::new(Sequence(\n            vec![Box::new(Or(Box::new(Sequence(vec![Box::new(Terminal('a'))])),\n                             Box::new(Sequence(\n                                 vec![Box::new(Repetition(Box::new(Terminal('b'))))]))))])),\n        Box::new(Sequence(vec![Box::new(Repetition(Box::new(Terminal('a'))))]))))])),\n    Box::new(Sequence(vec![Box::new(Terminal('a')), Box::new(Terminal('a')),\n                           Box::new(Terminal('b'))]))));\nassert_eq!(p.parse(), res);\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsingh93%2Fregex-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgsingh93%2Fregex-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsingh93%2Fregex-parser/lists"}