lua-patterns 0.3.0

Binding to Lua String Patterns
Documentation
1
2
3
4
5
6
7
8
9
extern crate lua_patterns as lp;

fn main() {
    let mut p = lp::LuaPattern::new("%s*(%d+)%s+(%S+)");
    if let Some((int,rest)) = p.match_maybe_2(" 233   hello dolly") {
        assert_eq!(int,"233");
        assert_eq!(rest,"hello");
    }
}