Macro nom::take_until_and_consume1 [−][src]
macro_rules! take_until_and_consume1 { ($i:expr, $substr:expr) => { ... }; }
take_until_and_consume1!(tag) => &[T] -> IResult<&[T], &[T]>
generates a parser consuming bytes (at least 1) until the specified byte sequence is found, and consumes it
The parsed input and the tag are removed from the remainder.
(As opposed to take_until1!
that does not remove the tag from the remainder.)
Example
named!(x, take_until_and_consume!("foo")); let r = x(&b"abcd foo efgh"[..]); assert_eq!(r, Ok((&b" efgh"[..], &b"abcd "[..])));