[−][src]Macro nom::take_while_s
Deprecated since 4.0.0:
Please use take_while
instead
take_while_s!(char -> bool) => &str -> IResult<&str, &str>
returns the longest list of characters until the provided function fails.
The argument is either a function char -> bool
or a macro returning a `bool
fn alphabetic(chr: char) -> bool { (chr >= 0x41 as char && chr <= 0x5A as char) || (chr >= 0x61 as char && chr <= 0x7A as char) } named!( alpha<&str,&str>, take_while_s!( alphabetic ) ); let r = alpha("abcd\nefgh"); assert_eq!(r,Ok(("\nefgh", "abcd")));