new example

This commit is contained in:
Steve Donovan 2017-04-18 15:44:29 +02:00
parent 9be8354722
commit 9ba61944b0

10
examples/range.rs Normal file
View file

@ -0,0 +1,10 @@
extern crate lua_patterns;
use lua_patterns::LuaPattern;
fn main() {
let mut m = LuaPattern::new("(%a+) one");
let text = " hello one two";
assert!(m.matches(text));
assert_eq!(m.capture(1),1..6);
assert_eq!(m.capture(0),1..10);
}