Daily Python Projects

Daily Python Projects

Using Regular Expressions (regex) to Extract Emails and Phone Numbers

Level: Real-World

Ardit Sulce's avatar
Ardit Sulce
Apr 01, 2024
∙ Paid

Project Brief

Your task for this project is to extract the email addresses and phone numbers from a piece of text.

Project Instructions

  1. Download this text file. The file contains the following text:
    "Contact us at support@example.com or marketing@example.com. For urgent queries, call us at (123) 456-7890 or 123.456.7890. Alternatively, reach out on 123-456-7890.”

  2. Write a script that extracts all the emails and all the phone numbers from that text file and prints them out in the terminal.

Expected Output

Keep reading with a 7-day free trial

Subscribe to Daily Python Projects to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Ardit Sulce · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture