Python Forum
Regular Expressions in Files (find all phone numbers and credit card numbers) - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Regular Expressions in Files (find all phone numbers and credit card numbers) (/thread-6722.html)



Regular Expressions in Files (find all phone numbers and credit card numbers) - Amirsalar - Dec-05-2017

Using regular expressions find all phone numbers and credit card numbers in the file findPhoneCC.txt in your Files folder. Place all found phone numbers and credit card numbers into separate lists (one list for phone numbers and another list for credit card numbers). Find which Dr. Who villains are listed in the file and place them into a list. Among the possible are: Mara, Rani, Zygon, Davros, Dalek, and Monk. Using the lists, write all elements of the lists to a new file.


RE: Regular Expressions in Files (find all phone numbers and credit card numbers) - micseydel - Dec-05-2017

We need to use your attempt. "Do it for me"-looking posts are unlikely to get helpful responses.


RE: Regular Expressions in Files (find all phone numbers and credit card numbers) - DeaD_EyE - Dec-05-2017

Write possible Credit-Card numbers down (not here). Compare which digits/chars are used where and how much of them.
Learn regex. A good place to start and test your possible regex is here: https://regex101.com/