import re


def is_special_character(string, i, pattern):
    """
    Returns True if the i-th character in the given string is a special
    character, False otherwise. The character is *not* a special character if
    it is a dot and it is surrounded by two digits, like in "1.23".

    >>> is_special_character(["a", "-", "b"], 0)
    False
    >>> is_special_character(["a", "-", "b"], 1)
    True
    >>> is_special_character(["1", ".", "2"], 1)
    False
    """

    if string is None or len(string) == 0:
        return False

    if pattern is None or len(pattern) == 0:
        return False

    if i < 0:
        return False

    if i >= len(string):
        return False

    char = string[i]

    # The character is *not* a special character if it doesn't match the
    # defined pattern.
    if not re.match(pattern, char):
        return False

    # The character is *not* a special character if it is a dot and it is
    # surrounded by two digits.
    if char == "." and i > 0 and i < len(string) - 1:
        prev_char = string[i - 1]
        next_char = string[i + 1]
        if prev_char.isdigit() and next_char.isdigit():
            return False
    return True