Open martindube opened 5 years ago
emailRegex = re.compile(r'([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(.[A-Z|a-z]{2,})+', re.VERBOSE) # regex for validating an email format
https://github.com/Shane004/Email-Scraping/tree/broader-quick-search
That is a new pull request for this project but it is limited you can only search domain specific emails for the bulk email....it would have been better if it could be possible to search every single domain present in the url
I use the following regex to also include email addresses with dot in the prefix:
emailRegex = re.compile(r'''
# Matches emails, example:
# something-.+_@somedomain.com
# hallo.test@info.server.com
(
([a-zA-Z0-9_.+-]+) # Username characters: letters, digits, dots, underscores, pluses, hyphens
@
([a-zA-Z0-9-]+ # Domain name part before last dot: letters, digits, hyphens
(\.[a-zA-Z0-9-]+)* # Optional middle subdomains: start with a dot, followed by letters, digits, hyphens
\.[a-zA-Z]{2,}) # Top-level domain: dot followed by two or more letters
)
''', re.VERBOSE)
Hi!
The email regex
email_expression
does not include email addresses with dot in the prefix.