Macro nom::one_of [] [src]

macro_rules! one_of {
    ($i:expr, $inp: expr) => { ... };
}

matches one of the provided characters

Example

named!(simple<char>, one_of!(&b"abc"[..]));
assert_eq!(simple(b"a123"), Ok((&b"123"[..], 'a')));

named!(a_or_b<&str, char>, one_of!("ab汉"));
assert_eq!(a_or_b("汉jiosfe"), Ok(("jiosfe", '汉')));