rusty_expressions 0.2.1

Oniguruma remade in pure Rust: named groups, look-around, backreferences, subexp calls, absent expressions, callouts, per-regex encodings (UTF-8/16/32, Shift_JIS, Big5, EUC-*, GB18030, ISO-8859-*) and Perl/Python/Java/POSIX/GNU/Emacs/grep syntax dialects. Match-equivalent to Oniguruma 6.9.10 and ~3x faster than libonig. no_std + alloc with default-features = false, runs on wasm32, no C toolchain.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use rusty_expressions::{Encoding, Options, Regex, Syntax};
fn main() {
    let re = Regex::new("ca+t", Options::NONE, Encoding::UTF8, Syntax::ONIGURUMA).unwrap();
    let m = re.search(b"one cat two").unwrap().expect("match");
    assert_eq!(m.range(), 4..7);
    let re = Regex::new_str(r"(?<key>\w+)=(?<val>\w+)", Options::NONE, Syntax::ONIGURUMA).unwrap();
    let m = re.search(b"path=api").unwrap().expect("match");
    assert_eq!(m.name("key"), Some(0..4));
    assert_eq!(m.name("val"), Some(5..8));
    println!("README examples OK");
}