rust-lang / rust-lang/rust-bindgen
Support case-insensitive regex patterns
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
Builder methods allowlist_* and blocklist_* do not support case-insensitive regex patterns like ((?i).*foo) (note the (?i) modifier).
If you try to use them:
let bindings = bindgen::Builder::default()
.header("myheader.h")
.allowlist_file("(?i).*foo") // case-insensitive regex
.generate()
you get errors like this:
regex parse error:
^((?i).*foo)$
^
error: Unicode-aware case insensitivity matching is not available (make sure the unicode-case feature is enabled)
As the error states, the unicode-case feature of the regex crate is required for such patterns. Unfortunately bindgen neither enables this feature nor expose a way to enable it.
A possible work around is for the user to to take a direct dependency on regex and configure the feature themselves. That works but is awkard. Ideally bindgen should provide native support.
To my knowledge this limitation is also not documented anywhere.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Builder allowlist_* and blocklist_* methods and trace how their regex patterns are constructed and how the regex crate features are configured. Check existing tests or documentation covering these methods. Done means case-insensitive patterns such as (?i).*foo work and the limitation or supported behavior is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100