Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8153525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:02:47+00:00 2026-06-06T16:02:47+00:00

Hi i was looking for a way to verify the domain with a provided

  • 0

Hi i was looking for a way to verify the domain with a provided email address
The domain names can be
http://www.test.free.com
http://www.free.com.au
http://www.free.com.au.org
http://www.free.com.org
or there can be a domain name with any number of sub sub domains and any number of verifications.

the verifying email should contain the domain and this is what i wrote so far

if domain_url is not None and verification_email is not None:

    logging.info('==============================')
    logging.info('BOTH WERE NOT NONE')
    logging.info('==============================')

    domain_email = verification_email.split('@')[1].split('.')[0]

    logging.info('==============================')
    logging.info(domain_email)
    logging.info('==============================')

    verify_domain_url_list = domain_url.split('.')

    if len(verify_domain_url_list) == 4:
        verify_domain_url_list.pop()
        verify_domain_url_list.pop()
    if len(verify_domain_url_list) == 3:
        verify_domain_url_list.pop()


    verify_status = domain_email in verify_domain_url_list

    if verify_status:
        return 'yes'
    else:
        pre_domain_address = verify_domain_url_list[0].split('//')[1]
        if pre_domain_address is not None and \
            domain_email in pre_domain_address:
            return 'yes'
        else:
            return 'no'
    return 'no' 

but this not matching for all the possibilities. can any one give a help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:02:48+00:00Added an answer on June 6, 2026 at 4:02 pm

    You can do it like this, just add the new domains inside the parenthesis.

    verification_email = 'fed@test.free.com'
    pattern = r'.*@(test.free.com|free.com.au|free.com.au.org|free.com.org)$'
    
    import re
    if re.search( pattern , verification_email):
        print('yes')
        # or on your case, return 'yes'
    

    https://github.com/fedmich/StackOverflow-answers/blob/master/python-11220230/regex.py

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking to emulate the password reset flow from www.live.com. That is (skip email
I'm looking at the capybara matchers documentation: http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Matchers I can't seem to find way
I am looking for a way to verify if my app was downloaded by
I'm looking for a way to verify against an array. I'm lost in the
I'm looking for a good way to maintain permissions on who can add data
I'm looking for way to verify whether a site is categorized in any url
I am looking for a better way to verify that no field is left
Im am looking for a way to verify if the number the user entered
I'm looking for the best way to verify that a given method (the unit)
What I am looking for is a way to programmatically verify a target object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.