Macro nom::take_until1

source ·
macro_rules! take_until1 {
    ($i:expr, $substr:expr) => { ... };
}
Expand description

take_until1!(tag) => &[T] -> IResult<&[T], &[T]> consumes data (at least one byte) until it finds the specified tag

The remainder still contains the tag.

Example

 named!(x, take_until1!("foo"));

 let r = x(&b"abcd foo efgh"[..]);

 assert_eq!(r, Ok((&b"foo efgh"[..], &b"abcd "[..])));