Macro nom::recognize [−][src]
recognize!(I -> IResult<I, O> ) => I -> IResult<I, I>
if the child parser was successful, return the consumed input as produced value
named!(x, recognize!(delimited!(tag!("<!--"), take!(5), tag!("-->")))); let r = x(&b"<!-- abc --> aaa"[..]); assert_eq!(r, Ok((&b" aaa"[..], &b"<!-- abc -->"[..])));