Function neure::re::zero_more

source ·
pub fn zero_more<'a, C, U>(unit: U) -> NeureZeroMore<C, U, C::Item, NullCond>where
    C: Context<'a>,
    U: Neu<C::Item>,
Expand description

Match at least zero item.

Example

    let num = re::zero_more('0'..='9');
    let mut ctx = CharsCtx::new("2048mb");

    assert_eq!(ctx.try_mat(&num)?, Span::new(0, 4));

    let mut ctx = CharsCtx::new("rust2021");

    assert_eq!(ctx.try_mat(&num)?, Span::new(0, 0));
    Ok(())