#[macro_use] extern crate scan_rules;
#[cfg(feature="regex")]
fn main() {
use scan_rules::scanner::{
NonSpace, Number, Word, max_width_a, exact_width_a, re_str, };
let inp = "25 54.32E-1 Thompson 56789 0123 56ß水";
let_scan!(inp; (
let i: i32, let x: f32, let str1 <| max_width_a::<NonSpace>(9),
let j <| exact_width_a::<i32>(2), let y: f32, let _: Number,
let str2 <| re_str(r"^[0-9]{1,3}"), let warr: Word
));
println!(
"Converted fields:\n\
i = {i:?}\n\
x = {x:?}\n\
str1 = {str1:?}\n\
j = {j:?}\n\
y = {y:?}\n\
str2 = {str2:?}\n\
warr = {warr:?}",
i=i, j=j, x=x, y=y,
str1=str1, str2=str2, warr=warr);
}
#[cfg(not(feature="regex"))]
fn main() {
panic!("This example requires the `regex` feature.");
}