{"id":16418503,"url":"https://github.com/nitely/nregex","last_synced_at":"2026-03-02T11:03:35.439Z","repository":{"id":54998592,"uuid":"233011367","full_name":"nitely/nregex","owner":"nitely","description":"A fast DFA based Regex engine that supports submatches","archived":false,"fork":false,"pushed_at":"2024-01-26T21:35:07.000Z","size":487,"stargazers_count":52,"open_issues_count":3,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-24T11:30:37.766Z","etag":null,"topics":["dfa","nim","nim-lang","regex","regex-engine"],"latest_commit_sha":null,"homepage":"https://nitely.github.io/nregex/","language":"Nim","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/nitely.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-01-10T09:21:51.000Z","updated_at":"2024-09-12T13:19:55.000Z","dependencies_parsed_at":"2024-11-10T06:41:50.439Z","dependency_job_id":"caf30ad3-c153-4e0b-b0ec-63402903b30f","html_url":"https://github.com/nitely/nregex","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/nitely/nregex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitely%2Fnregex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitely%2Fnregex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitely%2Fnregex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitely%2Fnregex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitely","download_url":"https://codeload.github.com/nitely/nregex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitely%2Fnregex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29999244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T09:59:02.300Z","status":"ssl_error","status_checked_at":"2026-03-02T09:59:02.001Z","response_time":60,"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":["dfa","nim","nim-lang","regex","regex-engine"],"created_at":"2024-10-11T07:14:18.242Z","updated_at":"2026-03-02T11:03:30.427Z","avatar_url":"https://github.com/nitely.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nregex\n\n[![licence](https://img.shields.io/github/license/nitely/nregex.svg?style=flat-square)](https://raw.githubusercontent.com/nitely/nregex/master/LICENSE)\n\nThis is currently a PoC for a DFA that supports submatches extraction. The match time complexity is linear in length of the text to match. [Read the article](https://nitely.github.io/2020/01/19/a-dfa-for-submatches-extraction.html) if you are interested in the implementation.\n\n\u003e [!WARNING]\n\u003e Pls use [nim-regex](https://github.com/nitely/nim-regex) for anything serious, instead of this package.\n\n## Install\n\n```\nnimble install nregex\n```\n\n# Compatibility\n\nNim +1.0.4\n\n## Usage\n\n```nim\nimport pkg/nregex\n\nvar m: RegexMatch\ndoAssert match(\"abc\", re\"abc\", m)\ndoAssert match(\"ab\", re\"a(b|c)\", m)\n\ndoAssert match(\"aabcd\", re\"(aa)bcd\", m)\ndoAssert m.group(0) == @[0 .. 1]\ndoAssert match(\"aab\", re\"((a)*b)\", m)\ndoAssert m.group(0) == @[0 .. 2]\ndoAssert m.group(1) == @[0 .. 0, 1 .. 1]\n\ndoAssert \"abcd\".find(re\"bc\", m)\ndoAssert \"2222\".find(re\"(22)*\", m)\ndoAssert m.group(0) == @[0 .. 1, 2 .. 3]\n\ndoAssert re\"bc\" in \"abcd\"\ndoAssert re\"(23)+\" in \"112323211\"\n```\n\n## Docs\n\n[Read the docs](https://nitely.github.io/nregex/)\n\n## Benchmarks\n\nThe following benchmarks show nregex is up to 22 times faster than PCRE. However, when the RE contains capture groups, PCRE is about 4 times faster than nregex.\n\n|  | relative | time/iter | iters/s | regex | text\n| --- | --- | --- | --- | --- | ---\nCPU | | 294.85ps | 3.39G\nPCRE | | 1.10ms | 912.11 | ^\\w\\*sol\\w\\*$ | (a\\*100000)sol(b\\*100000)\nnregex | 739.52% | 148.25us | 6.75K\nPCRE | | 174.87ns | 5.72M | ^[0-9]+-[0-9]+-[0-9]+$ | 650-253-0001\nnregex | 2280.84% | 7.67ns | 130.43M\nPCRE | | 179.23ns | 5.58M | ^[0-9]+..+$ | 650-253-0001\nnregex | 1447.15% | 12.38ns | 80.74M\n\n## Tests\n\n```\nnimble test\n```\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitely%2Fnregex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitely%2Fnregex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitely%2Fnregex/lists"}