pub fn bin_digit1<T, E>(input: T) -> Result<(T, T), Err<E>>
Expand description
Recognizes one or more binary characters: 0-1
Complete version: Will return an error if there’s not enough input data, or the whole input if no terminating token is found (a non binary digit character).
§Example
fn parser(input: &str) -> IResult<&str, &str> {
bin_digit1(input)
}
assert_eq!(parser("013a"), Ok(("3a", "01")));
assert_eq!(parser("a013"), Err(Err::Error(Error::new("a013", ErrorKind::BinDigit))));
assert_eq!(parser(""), Err(Err::Error(Error::new("", ErrorKind::BinDigit))));