#regex #bindings #text #ffi #native-bindings

sys vectorscan-rs-sys

Native bindings to the Vectorscan high-performance regex library

5 releases

0.0.5 Dec 9, 2024
0.0.4 Nov 7, 2024
0.0.3 Aug 22, 2024
0.0.2 Apr 18, 2024
0.0.1 Apr 5, 2024

#2368 in Parser implementations

Download history 30/week @ 2024-08-26 41/week @ 2024-09-02 15/week @ 2024-09-09 21/week @ 2024-09-16 125/week @ 2024-09-23 207/week @ 2024-09-30 100/week @ 2024-10-07 192/week @ 2024-10-14 165/week @ 2024-10-21 154/week @ 2024-10-28 173/week @ 2024-11-04 67/week @ 2024-11-11 192/week @ 2024-11-18 1/week @ 2024-11-25 169/week @ 2024-12-02 284/week @ 2024-12-09

650 downloads per month
Used in vectorscan-rs

Apache-2.0 OR MIT

2MB
807 lines

vectorscan-rs-sys

Overview

This crate implements minimal Rust bindings to the Vectorscan fork of Hyperscan, the high-performance regular expression engine. This crate builds a vendored copy of Vectorscan from source.

Dependencies

  • Boost >= 1.57
  • CMake
  • patch
  • Optional: Clang, when building with the bindgen feature

This has been tested on x86_64 Linux, x86_64 macOS, and aarch64 macOS.

Implementation Notes

This crate was originally written as part of Nosey Parker. It was adapted from the pyperscan project, which uses Rust to expose Hyperscan to Python. (That project is released under either the Apache 2.0 or MIT license.)

The only bindings exposed at present are for Vectorscan's block-based matching APIs. The various other APIs such as stream- and vector-based matching are not exposed. Other features, such as the Chimera PCRE library, test code, benchmark code, and supporting utilities are disabled.

The source of Vectorscan 5.4.11 is included here in the 5.4.11.tar.gz file.

At build time, a patch is applied to the Vectorscan sources. This patch does a few things:

  • The CMake-based build system is modified to eliminate the build-time dependency on ragel
  • The precompiled version of 4 Ragel .rl files are added to the source tree
  • The CMake-based build system is modified to allow disabling several components that are not used in this crate

License

This project is licensed under either of

at your option.

This project contains a vendored copy of Vectorscan, which is released under a 3-clause BSD license (LICENSE-VECTORSCAN).

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in vectorscan-rs-sys by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies