#Library for regexes?

13 messages · Page 1 of 1 (latest)

amber ivy
#

I'm looking for a library that can do regex matches, including unlimited-length lookbehinds. Unfortunately, regex, fancy-regex, and pcre2 don't support it. Any ideas where to look? Looking for something like the regex library (not re) from Python, but... ya'know, Rust. Crate suggestions would be appreciated!

cyan patio
amber ivy
# cyan patio 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
cyan patio
#

Try onig = { version = "6", default-features = false }

amber ivy
#

Maybe it's an XY Problem, but that would be hard

cyan patio
amber ivy
#

Fair enough, I'll try to optimize Python then. Thanks anyways! Re-writing the regex would be too hard in this case

cyan patio
#

they easily get into exponential time

amber ivy
stable pollen