import re


def to_address(text):
    """
    Convert address text with possible leading '#' to an interger address value.

    :param str text: Address text to convert

    :returns: Integer address or None if not a valid address

    """
    if isinstance(text, int):
        return int(text)
    if isinstance(text, str):
        try:
            value = int(re.sub(r'^#', '', text.strip()))
        except ValueError:
            return None
        return value
    return None