{"id":19789590,"url":"https://github.com/webfreak001/fuzzymatch","last_synced_at":"2026-03-19T11:44:41.594Z","repository":{"id":146626764,"uuid":"616241003","full_name":"WebFreak001/FuzzyMatch","owner":"WebFreak001","description":"Dead-simple, efficient string and array fuzzy matching library (string.contains, but better)","archived":false,"fork":false,"pushed_at":"2023-03-20T01:39:28.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T04:13:29.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebFreak001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["WebFreak001"],"patreon":"WebFreak"}},"created_at":"2023-03-20T01:35:25.000Z","updated_at":"2023-03-20T13:19:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"d67e22f6-4e90-4558-a4c5-641458bd7a2c","html_url":"https://github.com/WebFreak001/FuzzyMatch","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/WebFreak001%2FFuzzyMatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebFreak001%2FFuzzyMatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebFreak001%2FFuzzyMatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebFreak001%2FFuzzyMatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebFreak001","download_url":"https://codeload.github.com/WebFreak001/FuzzyMatch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241126669,"owners_count":19914057,"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-12T06:34:01.140Z","updated_at":"2026-03-03T07:41:23.379Z","avatar_url":"https://github.com/WebFreak001.png","language":"D","funding_links":["https://github.com/sponsors/WebFreak001","https://patreon.com/WebFreak"],"categories":[],"sub_categories":[],"readme":"# fuzzymatch\n\nDead-simple, efficient string and array fuzzy matching library.\n\nUsable for everyone:\n- GC \u0026 phobos range users\n- betterC users (case-sensitive dstring or no-decode array check only)\n- `@nogc` users (in all cases)\n- `string`, `wstring`, `dstring` users\n\n```d\nimport fuzzymatch;\n\nassert(\"path/to/game.txt\".fuzzyMatchesString(\"path/to/game.txt\"));\nassert(\"path/to/game.txt\".fuzzyMatchesString(\"path/to/game.\"));\nassert(\"path/to/game.txt\".fuzzyMatchesString(\"pathgametxt\"));\nassert(\"path/to/game.txt\".fuzzyMatchesString(\"ptg\"));\nassert(\"path/to/game.txt\".fuzzyMatchesString(\"game.txt\"));\nassert(!\"path/to/game.txt\".fuzzyMatchesString(\"work.txt\"));\n```\n## Documentation\n\nImplements a fuzzy search algorithm, yielding the same results as what the\nfuzzy match algorithm in VSCode matches. This is basically a fuzzy `contains`\n/ `canFind` method for strings and arrays.\n\nHowever this library does not offer any fuzzy match scoring. This\nfunctionality might be added in the future in new methods. The check-only\nmethods are ideal if the result is intended to be passed into other systems\nthat are responsible for display and sorting. (e.g. from DCD / serve-d into\nVSCode, IDEs or other editors)\n\nIt is quite efficient, allocates no memory and works with character ranges as\nwell as simple arrays. Pre-compiled string versions are available for reduced\ncompilation time for simple string/wstring/dstring matches.\n\nThis works by going through the search string character by character, on\nevery matching character, the matcher string advances by one character. If\nthe matcher string is completely checked, the fuzzy match returns true.\n\nMethods:\n- `fuzzyMatchesUni` - fuzzy contains method with unicode decoding\n- `fuzzyMatchesRaw` - fuzzy contains method on arbitrary arrays\n\n\n### fuzzyMatchesUni\n\n```d\n// rough definitions:\nbool fuzzyMatchesUni(\n\tbool caseSensitive = false, R1, R2\n)(\n\tin /* any char range or string */ R1 doesThis,\n\tin /* any char range or string */ R2 matchThis\n) @safe pure nothrow @nogc\n\n// pre-compiled case-insensitive variant:\nbool fuzzyMatchesString(\n\tin string /* or wstring or dstring */ doesThis,\n\tin string /* or wstring or dstring */ matchThis\n) @safe pure nothrow @nogc\n\n// case-sensitive variant:\nbool fuzzyMatchesStringCS(...) @safe pure nothrow @nogc\n```\n\nChecks if doesThis contains matchThis in a way that a fuzzy search would find\nit.\n\nPerforms basic case-insensitivity checks. UTF decodes strings and wstrings,\nskipping invalid characters. Note that the case-insensitive version does not\ncheck for unicode sequences, such as German `ß` matching `ss`, but only by\ncomparing single codepoints using their upper variant.\n\nTo perform no UTF decoding, either call this method with dstrings (UTF32\nstrings) or, if you checked that the string ONLY contains single code unit\nper user-conceived character, by using `.representation` and then\n`fuzzyMatchesRaw` - note that this method only works case-sensitive and\nwon't perform any case-transformations!\n\nIf you have strings, you can save compilation speed by using the pre-compiled\nmethod `fuzzyMatchesString`, which accepts strings, wstring or dstrings.\n\nThe `fuzzyMatchesStringCS` method is another pre-compiled version of\nthis fuzzyMatchesUni function, but performs caseSensitive checks.\n\nSee_Also:\n- `fuzzyMatchesRaw` - performs no unicode decoding, not usable with\nstrings, but with representations.\n\n\n### fuzzyMatchesRaw\n\n```d\n// rough definitions:\nbool fuzzyMatchesRaw(R1, R2)(\n\tin /* any range or array */ R1 doesThis,\n\tin /* any range or array */ R2 matchThis\n) @safe pure nothrow @nogc\n```\n\nWorks like `fuzzyMatchesUni`, but does not do any UTF decoding, but\nrather just goes through the arrays element-by-element.\n\nThis method works case-sensitive if dstrings are passed into it.\n\nThis method has no dependency on the standard library and should work with\nbetterC.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebfreak001%2Ffuzzymatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebfreak001%2Ffuzzymatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebfreak001%2Ffuzzymatch/lists"}