[][src]Function bitap::pattern_length_is_valid

pub fn pattern_length_is_valid(pattern_length: usize) -> bool

Returns whether the passed value is a valid pattern length.

Because of implementation details of the bitap algorithm itself, patterns can only be as long as the system word size minus one. That's 31/63 depending on the architecture you're compiling for. Additionally, patterns with a length of zero are rejected.