def validate_station(station):
    'Check that the station ID is well-formed.'
    if (station is None):
        return
    station = station.replace('.shtml', '')
    if (not re.fullmatch('ID[A-Z]\\d\\d\\d\\d\\d\\.\\d\\d\\d\\d\\d', station)):
        raise vol.error.Invalid('Malformed station ID')
    return station
Check that the station ID is well-formed.
def validate_station(station):
    
    if (station is None):
        return
    station = station.replace('.shtml', )
    if (not re.fullmatch('ID[A-Z]\\d\\d\\d\\d\\d\\.\\d\\d\\d\\d\\d', station)):
        raise vol.error.Invalid('Malformed station ID')
    return station