pub fn digit0<T, E: ParseError<T>>(
input: T
) -> IResult<T, <T as Stream>::Slice, E>where
T: Stream,
<T as Stream>::Token: AsChar,👎Deprecated since 0.1.0: Replaced with <code>winnow::character::digit0</code>
Expand description
Recognizes zero or more ASCII numerical characters: 0-9
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 digit character).
Example
fn parser(input: &str) -> IResult<&str, &str> {
digit0(input)
}
assert_eq!(parser("21c"), Ok(("c", "21")));
assert_eq!(parser("21"), Ok(("", "21")));
assert_eq!(parser("a21c"), Ok(("a21c", "")));
assert_eq!(parser(""), Ok(("", "")));WARNING: Deprecated, replaced with winnow::character::digit0