bparse

Function range

Source
pub fn range(lo: u8, hi: u8) -> ByteRange
Expand description

Returns a pattern that will match any byte in the closed interval [lo, hi]

use bparse::{Pattern, range};

let pattern = range(b'a', b'z');
assert_eq!(pattern.eval(b"b"), Some(1));