ayushagarwalk / Email-Scraping

Email Scraping with Python
46 stars 21 forks source link

Emails with dots does not match #1

Open martindube opened 5 years ago

martindube commented 5 years ago

Hi!

The email regex email_expression does not include email addresses with dot in the prefix.

babaoye commented 1 year 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

babaoye commented 1 year ago

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

oskarkraemer commented 4 months ago

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)