Python Forum
Regular Expressions in Files (find all phone numbers and credit card numbers)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular Expressions in Files (find all phone numbers and credit card numbers)
#1
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.
Reply
#2
We need to use your attempt. "Do it for me"-looking posts are unlikely to get helpful responses.
Reply
#3
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/
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Generator: From Word to Numbers, from Numbers to n possibles Words Yamiyozx 2 1,370 Jan-02-2023, 05:08 PM
Last Post: deanhystad
  Python OOP - two numbers ben1122 31 7,856 Oct-02-2021, 01:03 PM
Last Post: ben1122
  Check if all the numbers are higher than five and if not... banidjamali 3 2,059 Jan-11-2021, 11:25 AM
Last Post: banidjamali
  Counting numbers in other lines LewAlbert 6 99,915 Dec-12-2020, 07:38 PM
Last Post: deanhystad
  calculator with +2 expressions El_gnichi 1 1,733 Nov-25-2020, 11:42 PM
Last Post: Larz60+
  How can I found how many numbers are there in a Collatz Sequence that I found? cananb 5 3,715 Nov-23-2020, 05:15 PM
Last Post: cananb
  Convert list of numbers to string of numbers kam_uk 5 2,935 Nov-21-2020, 03:10 PM
Last Post: deanhystad
Smile Final Projet - Credit Risk Rauchvant 3 2,375 Nov-18-2020, 03:21 PM
Last Post: Rauchvant
  Getting largest indices of array less than or equal to an array of numbers schniefen 5 2,585 Nov-02-2020, 08:14 PM
Last Post: schniefen
  Positive and negative numbers in a row peterp 1 1,721 Oct-29-2020, 02:42 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020