exception Regex_no_such_subpattern of int * intRegex_no_such_subpattern (n, max) means n was requested but only max
subpatterns are defined (so max - 1 is the highest valid index)
Regex_no_such_named_subpattern (name, pattern)
exception Regex_no_such_named_subpattern of string * stringRegex_no_such_named_subpattern (name, pattern)
Match_failed pattern
exception Regex_match_failed of stringMatch_failed pattern
Regex_submatch_did_not_capture (s, i) means the ith subpattern in the
regex compiled from s did not capture a substring.
exception Regex_submatch_did_not_capture of string * intRegex_submatch_did_not_capture (s, i) means the ith subpattern in the
regex compiled from s did not capture a substring.
the string is the C library's error message, generally in the form of "(human-readable error): (piece of pattern that did not compile)"