{"id":14457401,"url":"https://github.com/cloudflare/wildcard","last_synced_at":"2025-10-23T23:31:37.319Z","repository":{"id":246814759,"uuid":"822643176","full_name":"cloudflare/wildcard","owner":"cloudflare","description":"Wildcard matching","archived":false,"fork":false,"pushed_at":"2024-12-04T21:24:01.000Z","size":47929,"stargazers_count":192,"open_issues_count":2,"forks_count":3,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-15T05:32:05.428Z","etag":null,"topics":["text-processing","wildcard"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudflare.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-07-01T14:27:53.000Z","updated_at":"2025-04-11T19:33:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"c6ebee2c-a006-477d-9974-a771548f1a46","html_url":"https://github.com/cloudflare/wildcard","commit_stats":{"total_commits":18,"total_committers":4,"mean_commits":4.5,"dds":0.2222222222222222,"last_synced_commit":"c560ef01dda595d038e2f46b91cd5804fccb00e0"},"previous_names":["cloudflare/wildcard"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fwildcard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fwildcard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fwildcard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fwildcard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudflare","download_url":"https://codeload.github.com/cloudflare/wildcard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337587,"owners_count":22054254,"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":["text-processing","wildcard"],"created_at":"2024-09-01T17:00:55.666Z","updated_at":"2025-10-23T23:31:37.241Z","avatar_url":"https://github.com/cloudflare.png","language":"Rust","readme":"[![Build Status](https://github.com/cloudflare/wildcard/workflows/CI/badge.svg)](https://github.com/cloudflare/wildcard/actions?query=workflow%3ACI)\n[![Dependency status](https://deps.rs/repo/github/cloudflare/wildcard/status.svg)](https://deps.rs/repo/github/cloudflare/wildcard)\n[![crates.io](https://img.shields.io/crates/v/wildcard.svg)](https://crates.io/crates/wildcard)\n[![Downloads](https://img.shields.io/crates/d/wildcard.svg)](https://crates.io/crates/wildcard)\n[![Github stars](https://img.shields.io/github/stars/cloudflare/wildcard.svg?logo=github)](https://github.com/cloudflare/wildcard/stargazers)\n[![Documentation](https://docs.rs/wildcard/badge.svg)](https://docs.rs/wildcard/)\n[![License](https://img.shields.io/crates/l/wildcard.svg)](./LICENSE)\n\n# `wildcard`\n\n\u003c!-- cargo-rdme start --\u003e\n\n`wildcard` is a rust crate for wildcard matching.\n\nHere's how to use it:\n\n```rust\nlet wildcard = Wildcard::new(\"*foo?*bar\".as_bytes()).unwrap();\n\nassert!(wildcard.is_match(\"fooofooobar\".as_bytes()));\n```\n\nSpecial characters can be escaped to represent their literal symbol:\n\n```rust\nlet wildcard = Wildcard::new(r\"\\*\\?\".as_bytes()).unwrap();\n\nassert!(!wildcard.is_match(\"ab\".as_bytes()));\nassert!(wildcard.is_match(\"*?\".as_bytes()));\n```\n\nYou can also capture the substring that matched the metasymbols of the wildcard:\n\n```rust\nlet wildcard = Wildcard::new(\"* is a * style?\".as_bytes()).unwrap();\n\nlet captures: Vec\u003c\u0026[u8]\u003e = wildcard.captures(\"Lambic is a beer style!\".as_bytes()).unwrap();\n\nassert_eq!(captures, [\"Lambic\".as_bytes(), \"beer\".as_bytes(), \"!\".as_bytes()]);\n```\n\n## String matching\n\nFor performance reasons `wildcard` does not match directly on strings, but it supports matching\non slices of `char`s:\n\n```rust\nlet p = \"*foo?*bar\".chars().collect::\u003cVec\u003c_\u003e\u003e();\nlet wildcard = Wildcard::new(\u0026p).unwrap();\n\nassert!(wildcard.is_match(\u0026\"fooofooobar\".chars().collect::\u003cVec\u003c_\u003e\u003e()));\n```\n\n## Matching customization\n\nWith `wildcard` you can configure these properties of a wildcard:\n\n1. Configure the symbols for the metasymbols `*` and `?` as well as the escape symbol.\n2. Support for the metasymbol `?` can be disabled.\n3. Support for escaping can be disabled.\n4. Support for case-insensitive matching.\n\n\u003c!-- cargo-rdme end --\u003e\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflare%2Fwildcard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudflare%2Fwildcard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflare%2Fwildcard/lists"}