def _get_regex(data, view, position, dummy0, opts, dummy1):
    """Decode a BSON regex to bson.regex.Regex or a python pattern object."""
    pattern, position = _get_c_string(data, view, position, opts)
    bson_flags, position = _get_c_string(data, view, position, opts)
    bson_re = Regex(pattern, bson_flags)
    return bson_re, position
Decode a BSON regex to bson.regex.Regex or a python pattern object.
stackoverflow/venv/lib/python3.6/site-packages/bson/__init__.py