• 🌙 Community Spirit

    Ramadan Mubarak! To honor this month, Crax has paused NSFW categories. Wishing you peace and growth!

Source Code Email spliter by domain , @gmail.com, @yahoo.com, @outlook.com . (1 Viewer)

Currently reading:
 Source Code Email spliter by domain , @gmail.com, @yahoo.com, @outlook.com . (1 Viewer)

Recently searched:

harchaoui2

Member
LV
1
Joined
Nov 9, 2023
Threads
10
Likes
4
Awards
4
Credits
666©
Cash
0$
source code for email spliter by domain :

import re

# Sample text containing email addresses
text = """
Here are some sample email addresses:
john.doe@gmail.com
jane.smith@yahoo.com
james.brown@hotmail.com
"""

# Regular expression to match email addresses
email_regex = r'\S+@\S+'

# Find all email addresses in the text
email_addresses = re.findall(email_regex, text)

# Create a dictionary to store emails by domain
email_domains = {}

# Split and group email addresses by domain
for email in email_addresses:
domain = email.split('@')[1]
if domain not in email_domains:
email_domains[domain] =
else:
email_domains[domain].append(email)

# Print email addresses grouped by domain
for domain, emails in email_domains.items():
print(f'Domain: {domain}')
for email in emails:
print(f' - {email}')
 
  • Like
Reactions: fognayerku

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Tips
Recently searched:

Similar threads

Users who are viewing this thread

Top Bottom