You can download this code by clicking the button below.
This code is now available for download.
Extracts all email addresses from the given text.
Technology Stack : Regular expressions (re)
Code Type : Function
Code Difficulty : Intermediate
import re
import math
import random
import json
import time
import os
import sys
import shutil
def extract_emails(text):
email_pattern = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
return re.findall(email_pattern, text)