Decode a BSON regex to bson.regex.Regex or a python pattern object.

def _get_regex(data, position, dummy0, dummy1):
    """Decode a BSON regex to bson.regex.Regex or a python pattern object."""
    pattern, position = _get_c_string(data, position)
    bson_flags, position = _get_c_string(data, position)
    bson_re = Regex(pattern, bson_flags)
    return bson_re, position