new example
This commit is contained in:
parent
9be8354722
commit
9ba61944b0
10
examples/range.rs
Normal file
10
examples/range.rs
Normal 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);
|
||||
}
|
Loading…
Reference in a new issue