Function utf8

Source
pub fn utf8(s: &str) -> Prefix<'_>
Expand description

Returns a new pattern that will match the utf8 string slice s at the start of the input.

use bparse::{Pattern, utf8};

let pattern = utf8("he");
assert_eq!(pattern.eval(b"hello"), Some(2));

As a convenience, the Pattern trait is implemented for string slices with the same effect:

use bparse::Pattern;

assert_eq!("he".eval(b"hello"), Some(2));