def process_string(string: str, pattern: str, func: Callable[[str], str]) -> str:
    """
    Apply a function to segments of a string that are unmatched by a regex pattern.

    This function splits a string based on a regex pattern to a list of strings, and invokes the
    supplied function (in `func=`) to those list elements that *do not* match the pattern (i.e.,
    the matched components are untouched). Finally, the processed list of text fragments is then
    joined back into a single .

    Parameters
    ----------
    string
        The string to process.
    pattern
        The regex pattern used for splitting the input string.
    func
        The function applied to elements that do not match the pattern.

    Returns
    -------
    str
        A processed string.
    """

    # Split the string by the pattern
    split_result = re.split(pattern, string)

    # Apply the function to elements that do not match the pattern
    processed_list = [func(part) if not re.match(pattern, part) else part for part in split_result]

    # Recombine the list elements to obtain a selectively processed string
    combined_str = "".join(processed_list)

    return combined_str

    Apply a function to segments of a string that are unmatched by a regex pattern.

    This function splits a string based on a regex pattern to a list of strings, and invokes the
    supplied function (in `func=`) to those list elements that *do not* match the pattern (i.e.,
    the matched components are untouched). Finally, the processed list of text fragments is then
    joined back into a single .

    Parameters
    ----------
    string
        The string to process.
    pattern
        The regex pattern used for splitting the input string.
    func
        The function applied to elements that do not match the pattern.

    Returns
    -------
    str
        A processed string.
    
great_tables/_text.py