pub fn not_line_ending<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
Expand description

Recognizes a string of any char except ‘\r’ or ‘\n’.

complete version: Will return an error if there’s not enough input data.

§Example

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

assert_eq!(parser("ab\r\nc"), Ok(("\r\nc", "ab")));
assert_eq!(parser("abc"), Ok(("", "abc")));
assert_eq!(parser(""), Ok(("", "")));