snacks 0.1.11

more nom parser-combinators
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use nom::error::ErrorKind;
use nom::{AsChar, IResult, Input};

pub fn alphanumdot0(input: &str) -> IResult<&str, &str> {
    input.split_at_position_complete(|char| !char.is_alphanum() || char != '.')
}

pub fn alphanumdot1(input: &str) -> IResult<&str, &str> {
    input.split_at_position1_complete(
        |char| !char.is_alphanum() || char != '.',
        ErrorKind::AlphaNumeric,
    )
}