Function neure::neu::wild

source ·
pub const fn wild() -> Wild
Expand description

Match all the characters except \n.

Example

use neure::prelude::*;
use neu::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let wild = wild();
    let wild = wild.repeat_times::<2>();
    let mut ctx = CharsCtx::new("aa\r\n");

    assert_eq!(ctx.try_mat(&wild)?, Span::new(0, 2));
    assert!(ctx.try_mat(&wild).is_err());
    Ok(())
}