Below output is the output result of code further down which returns expected scraped emails but note the extra capital U at the beginning and end of [email protected]’ which should be [email protected]. Why is this happening?
OUTPUT:
Email Results: [‘[email protected]’, ‘[email protected]’, ‘[email protected]’]
#! python3
import re
message = """Kristi Rainwater 501-371-2057 501-371-2001 [email protected]
Program Specialist for Academic
Challenge, Governor’s Scholarship
and Governor’s Distinguished
Scholarship
Lisa Smith 501-371-1049 501-371-2001 [email protected]
Program Specialist for Student
Outreach Services
Chris Wilson 501-371-1049 501-371-2001 [email protected]
"""
#EMAIL REGEX
EmailRE = re.compile(r'''
[a-zA-Z0-9.!#$%&'*+-/=?^_`{|]+ #first part of email
@ #@ part
[a-zA-Z0-9.!#$%&'*+-/=?^_`{|]+ #domain part of email
''', re.VERBOSE)
#EXTRACT EMAILS
EmailResult = EmailRE.findall(message)
print('Email Results: ', EmailResult)```
1