nom::is_a! [] [src]

macro_rules! is_a {
    ($input:expr, $arr:expr) => { ... };
}

is_a!(&[T]) => &[T] -> IResult<&[T], &[T]> returns the longest list of bytes that appear in the provided array

 named!(abcd, is_a!( "abcd" ));

 let r1 = abcd(&b"aaaaefgh"[..]);
 assert_eq!(r1, Done(&b"efgh"[..], &b"aaaa"[..]));

 let r2 = abcd(&b"dcbaefgh"[..]);
 assert_eq!(r2, Done(&b"efgh"[..], &b"dcba"[..]));