#pcre #regex #jit #pcre2

sys pcre2-sys

Low level bindings to PCRE2

3 unstable releases

✓ Uses Rust 2018 edition

new 0.2.0 Apr 14, 2019
0.1.1 Aug 20, 2018
0.1.0 Aug 18, 2018

#5 in #pcre

Download history 202/week @ 2018-12-30 314/week @ 2019-01-06 301/week @ 2019-01-13 379/week @ 2019-01-20 302/week @ 2019-01-27 280/week @ 2019-02-03 260/week @ 2019-02-10 264/week @ 2019-02-17 297/week @ 2019-02-24 269/week @ 2019-03-03 290/week @ 2019-03-10 261/week @ 2019-03-17 278/week @ 2019-03-24 260/week @ 2019-03-31 280/week @ 2019-04-07

1,233 downloads per month
Used in 4 crates (1 directly)

Unlicense/MIT

3.5MB
81K SLoC

C 77K SLoC // 0.1% comments Rust 2K SLoC // 0.0% comments Batch 1K SLoC // 0.0% comments Python 419 SLoC // 0.4% comments Shell 242 SLoC // 0.3% comments

pcre2-sys

Bindings for PCRE2.

Linux build status Windows build status

Dual-licensed under MIT or the UNLICENSE.

Documentation

https://docs.rs/pcre2-sys

Usage

Add this to your Cargo.toml:

[dependencies]
pcre2-sys = "0.1"

and this to your crate root:

extern crate pcre2_sys;

Notes

As a -sys crate, this exposes only the bindings to PCRE2 based on the header file. The PCRE2 documentation itself should be consulted in order to use this crate.

The bindings for this crate were generated for PCRE 10.31. This crate intends to track the current release of PCRE2.

The build script for this crate prefers dynamically linking with the host's PCRE2 system library. If that isn't available or if static linking is desired, then PCRE2 is built from source and statically linked.

Static linking will automatically happen for MUSL targets, but can be forced by setting the PCRE2_SYS_STATIC environment variable to 1.

Currently, this crate only supports libpcre-8 where PCRE2_CODE_UNIT_WIDTH=8.

This crate has been tested to work on Windows, Linux and macOS. Other platforms may work, and PRs to support them are welcome.

If you're compiling this crate on Windows with the GNU toolchain, then you'll need to make sure you have a compatible C compiler installed, such as the one provided by the mingw-w64 project.

Set the PCRE2_SYS_DEBUG flag to forcefully enable debug symbols when doing a static build, even when compiling in release mode.

Dependencies