combine::parser::char

Function alpha_num

Source
pub fn alpha_num<I>() -> AlphaNum<I>
where I: Stream<Item = char>, I::Error: ParseError<I::Item, I::Range, I::Position>,
Expand description

Parses either an alphabet letter or digit according to std::char::is_alphanumeric.

use combine::Parser;
use combine::parser::char::alpha_num;
assert_eq!(alpha_num().parse("A"), Ok(('A', "")));
assert_eq!(alpha_num().parse("1"), Ok(('1', "")));
assert!(alpha_num().parse("!").is_err());