the number of bytes starting at the given location that match (or do not match if invert is true) the byte ranges in chars.
See Implementation