strscan

Crates.iostrscan
lib.rsstrscan
version0.1.1
sourcesrc
created_at2015-06-22 02:13:28.895357
updated_at2015-12-11 23:56:18.321051
descriptionSimple rust library for matching text against regular expressions for use in lexers or other software.
homepage
repositoryhttps://github.com/luke-gru/rs_strscan
max_upload_size
id2441
size10,018
Luke Gruber (luke-gru)

documentation

README

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).

Commit count: 4

cargo fmt