Function winnow::character::complete::alpha1

source ·
pub fn alpha1<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::alpha1</code>
Expand description

Recognizes one or more lowercase and uppercase ASCII alphabetic characters: a-z, A-Z

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 alphabetic character).

Example

fn parser(input: &str) -> IResult<&str, &str> {
    alpha1(input)
}

assert_eq!(parser("aB1c"), Ok(("1c", "aB")));
assert_eq!(parser("1c"), Err(ErrMode::Backtrack(Error::new("1c", ErrorKind::Alpha))));
assert_eq!(parser(""), Err(ErrMode::Backtrack(Error::new("", ErrorKind::Alpha))));

WARNING: Deprecated, replaced with winnow::character::alpha1