3 releases (breaking)
Uses old Rust 2015
0.3.1 |
|
---|---|
0.3.0 | Dec 27, 2015 |
0.2.0 | Dec 25, 2015 |
0.1.0 | Dec 24, 2015 |
#8 in #regular-expressions
35KB
759 lines
Rust bindings for the Oniguruma regular expressions library.
Links
How to install
In Cargo.toml
:
[dependencies]
oniguruma = "0.1"
In src/main.rs
:
extern crate oniguruma;
Example of usage
use oniguruma::Regex;
let regex = Regex::new("e(l+)").unwrap();
for (i, pos) in regex.captures("hello").unwrap().iter_pos().enumerate() {
match pos {
Some((beg, end)) =>
println!("Group {} captured in position {}:{}", i, beg, end),
None =>
println!("Group {} is not captured", i)
}
}
lib.rs
:
Rust bindings for the Oniguruma regular expressions library.
Example of usage:
use oniguruma::Regex;
let regex = Regex::new("e(l+)").unwrap();
for (i, pos) in regex.captures("hello").unwrap().iter_pos().enumerate() {
match pos {
Some((beg, end)) =>
println!("Group {} captured in position {}:{}", i, beg, end),
None =>
println!("Group {} is not captured", i)
}
}
Dependencies
~185KB