Match a Regex against a (presumed UTF-8 encoded) ByteString,
returning the matched text and a map of (offset, size)
pairs for captures. Note that all matches are from the
beginning of the string (a ^ anchor is implicit). As in
PCRE, the match returned is the first one that a backtracking
matcher would find (leftmost alternatives are preferred), which
is not necessarily the longest. Note also that to avoid
pathological performance in certain cases, the matcher is limited
to considering 2000 possible matches at a time; when that
threshold is reached, it discards lower-priority matches. Hence
certain regexes may incorrectly fail to match: e.g. a*a{3000}$
on a string of 3000 as.