import re


def filter_urls(url_to_check) -> bool:
    """
        Filters the URLs collected so that  only those  from  http://www.bbc.co.uk and https://www.bbc.co.uk
        are kept. To remove the remaining non useful URLs we  assume  every  valid BBC article has a 8 digit
        string in its URI  and discard those which  do not.

        @Returns  bool True  if URL is valid.
    """
    searchobj = re.search(r'[0-9]{8}', url_to_check)
    if ('http://www.bbc.co.uk' or 'https://www.bbc.co.uk' in url_to_check) and (searchobj is not None):
        # print(f'URL added to list is : {url_to_check}  ')
        return True
    else:
        # print('URL is not added to the list, it  may be outside BBC.co.uk news or not an news article')
        return False