def METHOD_NAME(tab: tabs.FileTab) -> tuple[str, str, bool]:
    config = tab.settings.get("autoindent_regexes", Optional[AutoIndentRegexes])
    if config is None:
        config = AutoIndentRegexes()
    assert isinstance(config, AutoIndentRegexes)
    if config.indent is not None:
        try:
            re.compile(config.indent)
        except re.error:
            log.warning(f"invalid indent regex: {config.indent}")
            config.indent = None
    if config.dedent is not None:
        try:
            re.compile(config.dedent)
        except re.error:
            log.warning(f"invalid dedent regex: {config.dedent}")
            config.dedent = None
    return (
        config.indent or r"this regex matches nothing^",
        config.dedent or r"this regex matches nothing^",
        config.dedent_prev_line,
    )