I have a text file that contains bunch of phone numbers. Some contain invalid characters and some are too long. How do i read this file into a list using regex. I only want valid phone numbers to populate the list, and skip the invalid ones.
this is what i have so far:
phoneNumbers =  file2read = open('PhoneNumbers.txt', 'r') for currentline in file2read: phoneNumbers.append(currentline.rstrip()) file2read.close()