Answers for "python find email in string"

0

finding email id from string python

import re

my_str = "Hi my name is John and email address is [email protected] and my friend's email is [email protected]"
emails = re.findall("([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+)", my_str)

for mail in an email:
print(mail)
Posted by: Guest on April-08-2021
0

extract email address using expression in django

import re
s = 'Hello from [email protected] to [email protected] about the meeting @2PM'
  
# S matches any non-whitespace character 
# @ for as in the Email 
# + for Repeats a character one or more times 
lst = re.findall('S+@S+', s)
print(lst)
#['[email protected]', '[email protected]']
Posted by: Guest on November-19-2020
0

python - regexp to find part of an email address

# Visit: https://regexr.com/
# and look at the Menu/Cheatsheet
import re

# Extract part of an email address
email = '[email protected]'

# Option 1
expr = '[a-z]+'
match = re.findall(expr, email)
name = match[0]
domain = f'{match[1]}.{match[2]}'

# Option 2
parts = email.split('@')
Posted by: Guest on August-13-2020

Code answers related to "python find email in string"

Python Answers by Framework

Browse Popular Code Answers by Language