Daily Python Projects

Daily Python Projects

Share this post

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

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

Level: Real-World

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

Share this post

Daily Python Projects
Daily Python Projects
Using Regular Expressions (regex) to Extract Emails and Phone Numbers
1
Share

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

This post is for paid subscribers

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

Share