{"id":16253753,"url":"https://github.com/selfint/normal","last_synced_at":"2025-07-10T08:39:38.425Z","repository":{"id":128267633,"uuid":"584537958","full_name":"selfint/normal","owner":"selfint","description":"Rust library for writing regular expressions","archived":false,"fork":false,"pushed_at":"2023-01-11T16:34:21.000Z","size":24,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T08:49:12.775Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/selfint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-01-02T21:18:20.000Z","updated_at":"2023-01-02T21:18:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"5905b46d-b6dc-4ce0-b3bb-f2a3b60e9ec7","html_url":"https://github.com/selfint/normal","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfint%2Fnormal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfint%2Fnormal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfint%2Fnormal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfint%2Fnormal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selfint","download_url":"https://codeload.github.com/selfint/normal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247846680,"owners_count":21006088,"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-10-10T15:18:29.566Z","updated_at":"2025-04-08T12:46:52.552Z","avatar_url":"https://github.com/selfint.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Normal\n\nA simple library for writing readable regular expressions.\n\nWriting regular expressions isn't (usually) an often occurrence. The goal of this library\nis to make reading/writing regular expressions easier, now and in the future, and not needing to remember/re-learn the PCRE syntax each time.\n\nIn the future, maybe adding full documentation to all the methods/constants can make this\nlibrary a way to also learn PCRE syntax.\n\n## Example\n\n```rs\nuse normal::prelude::*;\n\nlet expression = \"example\"\n        .then_repeated_between(\n            2,\n            5,\n            named_group(\n                \"name\",\n                \"named group\"\n                    .then_non_capturing_group(\"non capturing group\")\n                    .then(\"repeated 2 to 5 times\")\n            ),\n        )\n        .then(NEWLINE);\n\nlet raw = \"example(?P\u003cname\u003enamed group(?:non capturing group)repeated 2 to 5 times){2,5}\\\\n\";\n\nassert_eq!(expression, raw);\n```\n\n## Supported PCRE syntax\n\nSyntax cheat sheet taken from [debuggex.com](https://www.debuggex.com/cheatsheet/regex/pcre).\n\n- [x] Basics:\n  - [x] then\n  - [x] |\n- [x] Quantifiers:\n  - [x] *\n  - [x] +\n  - [x] ?\n  - [x] {amount}\n  - [x] {min,max}\n  - [x] {min,}\n- [x] Groups:\n  - [x] Un-named - `(...)`\n  - [x] Named - `(?P\u003cname\u003e...)`\n  - [x] Non capturing - `(?...)`\n  - [x] Atomic - `(?\u003e...)`\n  - [x] Branch reset groups - `(?|...)`\n  - [x] Match capture group by number - `\\Y`\n  - [x] Match capture group by name - `(?P=name)`\n  - [x] Match capture group by name or number - `\\g{Y}`\n  - [x] Recurse into pattern - `(?R)`\n  - [x] Recurse into group by number - `(?Y)`\n  - [x] Recurse into group by name - `(?\u0026name)`\n  - [x] Recurse into group by name or number - `\\g\u003cY\u003e`\n  - [ ] Comment - `(?#...)` (do we need this?)\n- [x] Constants\n- [x] Assertions:\n  - [x] Positive lookahead - `(?=...)`\n  - [x] Negative lookahead - `(?!...)`\n  - [x] Positive lookbehind - `(?\u003c=...)`\n  - [x] Negative lookbehind - `(?\u003c!...)`\n  - [x] Conditional - `(?()|)`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfint%2Fnormal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselfint%2Fnormal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfint%2Fnormal/lists"}