multiple_captures/
multiple_captures.rs

1extern crate lua_patterns as lp;
2
3fn main() {
4    let mut p = lp::LuaPattern::new("%s*(%d+)%s+(%S+)");
5    if let Some((int, rest)) = p.match_maybe_2(" 233   hello dolly") {
6        assert_eq!(int, "233");
7        assert_eq!(rest, "hello");
8    }
9}