pub fn anychar<T, E: ParseError<T>>(input: T) -> IResult<T, char, E>where
T: InputIter + InputLength + Slice<RangeFrom<usize>>,
<T as InputIter>::Item: AsChar,
👎Deprecated since 8.0.0: Replaced with
nom8::bytes::any
with input wrapped in nom8::input::Streaming
Expand description
Matches one byte as a character. Note that the input type will
accept a str
, but not a &[u8]
, unlike many other nom parsers.
Streaming version: Will return Err(nom8::Err::Incomplete(_))
if there’s not enough input data.
Example
assert_eq!(anychar::<_, (_, ErrorKind)>("abc"), Ok(("bc",'a')));
assert_eq!(anychar::<_, (_, ErrorKind)>(""), Err(Err::Incomplete(Needed::new(1))));
WARNING: Deprecated, replaced with nom8::bytes::any
with input wrapped in nom8::input::Streaming