Skip to content

luke-gru/rs_strscan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rs_strscan

Simple rust library for matching text against regular expressions for use in lexers or other software.

Basic Usage

extern crate strscan;
use strscan::StringScanner;

let s = StringScanner::new(input_string);
let r_chars = Regex::new(r"\A\s*(\w+)\s*")

let res = s.scan(r_chars)
println!("chars with possible space: {}", res.unwrap());
println!("chars: {}", s.match_at(1).unwrap());

Rust Compatibility

Uses the 'collections' feature in order to use unstable string APIs (namely String#slice_chars). Rust nightly only.

Latest tests with rustc 1.2.0-nightly (c6b148337 2015-06-12).

About

String scanning library for rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages