pub fn bin_digit0<T, E>(input: T) -> Result<(T, T), Err<E>>
Expand description
Recognizes zero or more binary characters: 0-1
Complete version: Will return the whole input if no terminating token is found (a non binary digit character).
ยงExample
fn parser(input: &str) -> IResult<&str, &str> {
bin_digit0(input)
}
assert_eq!(parser("013a"), Ok(("3a", "01")));
assert_eq!(parser("a013"), Ok(("a013", "")));
assert_eq!(parser(""), Ok(("", "")));