Prerequisite : Pattern Matching with Python Regex
Given the URL text-file, the task is to extract all the email-ids from that text file and print the
urllib.request library can be used to handle all the URL related work.
Input : Hello This is Geeksforgeeks firstname.lastname@example.org email@example.com GfG is a portal for geeks firstname.lastname@example.org email@example.com Output :   ['firstname.lastname@example.org'] ['email@example.com']  ['firstname.lastname@example.org'] ['email@example.com']
URL text file can be handled using
urllib.request. For extracting the emails using regular expressions,
re library can be used. For more details of Regular Expression, refer this.
  ['firstname.lastname@example.org'] ['email@example.com']  ['firstname.lastname@example.org'] ['email@example.com']
- Extract numbers from a text file and add them using Python
- Extract text from PDF File using Python
- Python | Extract URL from HTML using lxml
- Convert Text and Text File to PDF using Python
- Python - Extract hashtags from text
- Extract IP address from file using Python
- How to extract Time data from an Excel file column using Pandas?
- How to extract Email column from Excel file and find out the type of mail using Pandas?
- How to extract date from Excel file using Pandas?
- Python program to Count the Number of occurrences of a key-value pair in a text file
- Python program to Reverse a single line of a text file
- Python program to reverse the content of a file and store it in another file
- Python | Program to extract frames using OpenCV
- Python: Convert Speech to text and text to Speech
- Python | Scramble words from a text file
- Python | Count occurrences of each word in given text file (Using dictionary)
- Python | Create an empty text file with current date as its name
- Python | Finding 'n' Character Words in a Text File
- Convert Text file to JSON in Python
- Saving Text, JSON, and CSV to a File in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.