def __init__(self,
                 regex_dict: Dict[str, str],
                 flags: int = re.U | re.I | re.M,
                 span_getter: Optional[Callable[[re.Match], Tuple[int, int]]] = None):
        '''

        :param regex_dict: dict
            This should be a dictionary mapping a label to the text of a regular expression
            e.g., {'AorB': r'(a|b)', 'Number: r'\d+'}
        :param flags: int, default re.U | re.I | re.M
            Same as re   flags
        :param span_getter : Optional[Callable[[re.Match], Tuple[int, int]]]
            Takes a match and returns a span. default: `lambda match: match.span()`
        '''
        self.flags = flags
        self.labeled_regexes = [[k, re.compile(v, self.flags)] for k, v in regex_dict.items()]
        if span_getter is None:
            self.span_getter = lambda match: match.span()
        else:
            self.span_getter = span_getter


        :param regex_dict: dict
            This should be a dictionary mapping a label to the text of a regular expression
            e.g., {'AorB': r'(a|b)', 'Number: r'\d+'}
        :param flags: int, default re.U | re.I | re.M
            Same as re   flags
        :param span_getter : Optional[Callable[[re.Match], Tuple[int, int]]]
            Takes a match and returns a span. default: `lambda match: match.span()`
        
scattertext/features/RegexFeatAndOffsetGetter.py