#Library for regexes?
13 messages · Page 1 of 1 (latest)
What about https://crates.io/crates/onig ?
Seemed promising. But, I'm getting this on build. I found something suggesting clang, but it's already installed (I'm on Linux):
error: failed to run custom build command for `onig_sys v69.8.1`
Caused by:
process didn't exit successfully: `/(REMOVED)/target/debug/build/onig_sys-3d7339d14aefcb54/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=RUSTONIG_DYNAMIC_LIBONIG
cargo:rerun-if-env-changed=RUSTONIG_STATIC_LIBONIG
cargo:rerun-if-env-changed=RUSTONIG_SYSTEM_LIBONIG
--- stderr
thread 'main' panicked at /(REMOVED)/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.59.2/src/ir/context.rs:878:9:
"OnigValue_struct_(unnamed_at_oniguruma/src/oniguruma_h_786_3)" is not a valid Ident
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Try onig = { version = "6", default-features = false }
The other workaround is ```rs
[dependencies]
onig = { git = "https://github.com/rust-onig/rust-onig", revision = "fa90c0e97e90a056af89f183b23cd417b59ee6a2" }
[patch.crates-io]
onig_sys = { git = "https://github.com/rust-onig/rust-onig", revision = "fa90c0e97e90a056af89f183b23cd417b59ee6a2" }
That got it to build, so thank you! Sadly, it still doesn't seem to support the regex Error(OnigError(-122), invalid pattern in look-behind) :-(
Maybe it's an XY Problem, but that would be hard
If onig doesn't support it I doubt anything will. Ruby is known as having a really lenient Regex system
Fair enough, I'll try to optimize Python then. Thanks anyways! Re-writing the regex would be too hard in this case
fair warning that regexes with this type of thing are insanely expensive to run
they easily get into exponential time
Yeah... that was the "XY problem" part, to an extent. The real solution is fix the regex, probably. But that's hard here
can you show the regex, then?