GitShow/BurntSushi/rust-pcre2
BurntSushi

rust-pcre2

High level Rust bindings to PCRE2.

by BurntSushi
Star on GitHubFork

C

64 stars42 forks12 contributorsQuiet · 11mo agoSince 2018

Meet the team

See all 12 on GitHub →
BurntSushi
BurntSushi83 contributions
atouchet
atouchet4 contributions
carenas
carenas2 contributions
LeoniePhiline
LeoniePhiline2 contributions
igor-raits
igor-raits1 contribution
er-vin
er-vin1 contribution
yelkarama
yelkarama1 contribution
b8591340
b85913401 contribution

Languages

View on GitHub →
C95.9%
Rust4%
Shell0.1%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
42
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 9 in progress · Last activity 11mo ago
See all on GitHub →
inxbit
Expose match_limit and depth_limit on RegexBuilderOpenPR

Adds two new methods on , mirroring the existing knob: — wraps . Caps the number of internal iterations. — wraps . Caps nested backtracking depth. Motivation Downstream callers running PCRE2 over potentially-adversarial input — for example, a terminal-output highlighter applying user-configured regexes to remote-device output — want explicit upper bounds on worst-case match CPU and recursion. The existing only bounds JIT memory; these two complete the picture on the interpreter path. Implementation Extends in with two new optional fields. Applies them in immediately after . Both PCRE2 setters always return zero per upstream docs, but the return code is 'd defensively so an unexpected upstream change would surface immediately. No new FFI bindings needed — already exports and . Default value is for both, preserving current behavior bit-for-bit. Tests Three new tests in : — against with produces a match-limit error. — against with produces a depth-limit error; same pattern matches with the default. — sanity that the new knobs don't change default behavior. Existing 24 lib tests and 7 doctests still pass; is clean. Smoke-tested by patching a downstream consumer ( ↔ ) to confirm the public API integrates without further changes.

inxbit · 3w ago
basvandijk
pcre2-sys: sort C sources for reproducible buildsOpenPR

When building the bundled PCRE2 (, or musl targets), enumerates the C sources with and hands them to in that order. yields entries in the filesystem's directory-iteration order, which is stable on any one machine but differs across machines — e.g. ext4 iterates in name-hash order with a per-filesystem seed chosen at mkfs time. That order becomes the member order of the static archive built by , so the same crate version produces byte-different artifacts on different machines. The member order also survives into binaries that link the archive: the linker records one symbol per loaded member, in load order. We found this while verifying the reproducibility of dfinity/ic's GuestOS image: one binary linking pcre2 was the only file in the ~10 GB image that differed between builds on two machines, and the entire difference was the permuted order of its symbol-table entries (the compiled objects themselves were byte-identical). Fix: collect the paths and sort them before adding them to the builder. No functional change — same file set, deterministic order. Repro sketch: build any crate depending on with on two machines with differently-seeded ext4 filesystems (or any two filesystems with different iteration order) and compare of the produced . 🤖 Generated with Claude Code

basvandijk · 1mo ago
michaelfeil
support PCRE2_ALT_EXTENDED_CLASS build optionOpenIssue

PCRE2_ALT_EXTENDED_CLASS: In official PCRE2 docs confirm it enables UTS #18 classes like [x&&[^y]], but the safe Rust pcre2 builder does not expose that option today. Using it would require a lower-level pcre2-sys wrapper or upstreaming a builder knob. Sources: PCRE2 syntax docs and API docs. I would like to have a builder knob in pycre2.

michaelfeil · 1mo ago

Recent fixes

View closed PRs →
6d7a
Fix/always build staticMergedPR

Since we need a PCRE2 configuration that is incompatible with standard system we always need to build a static library from source.

6d7a · 6mo ago
Structured data for AI agents

Repository: BurntSushi/rust-pcre2. Description: High level Rust bindings to PCRE2. Stars: 64, Forks: 42. Primary language: C. Languages: C (95.9%), Rust (4%), Shell (0.1%). Open PRs: 9, open issues: 6. Last activity: 11mo ago. Community health: 42%. Top contributors: BurntSushi, atouchet, carenas, LeoniePhiline, igor-raits, er-vin, yelkarama, b8591340, bczhc, heiher and others.

·@ofershap

Replace github.com with gitshow.dev