Open
Description
Expectation with scenario 1 is that the remaining to parse string does not container either of the /
as they should be consumed by the outer group.
use nom::error::ErrorKind;
use nom_regex::str::re_captures;
fn main() {
println!("{}", "Broken / still in remaining to parse");
let re = regex::Regex::new(r"^([/](.+)[/])").unwrap();
let parser = re_captures::<(&str, ErrorKind)>(re);
println!("{:?}", parser("/pr[]-/ && abc"));
println!("{}", "Works but needs post processing");
let re = regex::Regex::new(r"^([/].+[/])").unwrap();
let parser = re_captures::<(&str, ErrorKind)>(re);
println!("{:?}", parser("/pr[]-/ && abc"));
println!("{}", "/ still in remaining to parse");
let re = regex::Regex::new(r"^[/](.+)[/]").unwrap();
let parser = re_captures::<(&str, ErrorKind)>(re);
println!("{:?}", parser("/pr[]-/ && abc"));
}
repl.it https://replit.com/@merc1031/IllAttentiveDrivers#src/main.rs
Metadata
Metadata
Assignees
Labels
No labels