def METHOD_NAME(self, mapping: Union[List[Tuple[str, str]], Tuple[str, str]]):
    """Register a regexp -> label mapping.
    :param mapping: A list of tuples or a single tuple representing a mapping as regexp -> label
    """
    mapping = self._listify(mapping)
    for regexp, label in mapping:
        try:
            self._regexp_mapping[label] = re.compile(regexp)
        except re.error as err:
            raise re.error(
                f"Couldn't compile regexp '{regexp}' for label '{label}'. Aborted with error: '{err.msg}'"
            )