Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit contains a new sub-crate called
regex-capi
which providesa C library called
rure
.A new
RegexBuilder
type was also added to the Rust API proper, whichpermits both users of C and Rust to tweak various knobs on a
Regex
.This fixes issue #166.
Since it's likely that this API will be used to provide bindings to
other languages, I've created bindings to Go as a proof of concept:
https://github.com/BurntSushi/rure-go --- to my knowledge, the wrapper
has as little overhead as it can. It was in particular important for the
C library to not store any pointers provided by the caller, as this can
be problematic in languages with managed runtimes and a moving GC.
The C API doesn't expose
RegexSet
and a few other convenience functionssuch as splitting or replacing. That can be future work.
Note that the regex-capi crate requires Rust 1.9, since it uses
panic::catch_unwind
.This also includes tests of basic API functionality and a commented
example. Both should now run as part of CI.