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 1095877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:11:42+00:00 2026-05-17T00:11:42+00:00

I think many people have done some similar development tasks before: I would like

  • 0

I think many people have done some similar development tasks before:

I would like to check the people’s email address whether only match @tomtom.com or @stream.com.

Currently, I have two solutions in my mind:

  1. Using indexof() function

    var checkTomTomEmail=eo.data.username.indexOf("@tomtom.com");
    var checkStreamEmail=eo.data.username.indexOf("@stream.com");
    
    
    if (checkTomTomEmail >0 || checkStreamEmail >0 )
    {
        //Run the login code
    }
    
    
    Else 
    {
        //Please login with your tomtom or stream email 
    }
    
  2. Using match

    var patt1=/@tomtom.com/gi;
    var patt2=/@stream.com/gi;
    var checkTomTomEmail=eo.data.username.match(patt1);
    var checkStreamEmail=eo.data.username.match(patt2);
    
    
    if(indexOf(checkTomTomEmail)> 1 ||indexOf (checkStreamEmail)>1)
    {
        //Login 
    }
    

I still think I do not consider all the detail yet. Any suggestions?
Thanks

  • 1 1 Answer
  • 1 View
  • 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-05-17T00:11:43+00:00Added an answer on May 17, 2026 at 12:11 am

    Perhaps if people are only allowed to enter emails for those two addresses you should only collect the username and then allow them to choose @tomtom.com or @stream.com using radiobuttons.

    If you still want to go the javascript route then your regex can be combined into a single statement

    var emailPatt=/@(tomtom|stream).com/gi;
    
    if(emailPatt.test(eo.data.username))
    {
        //Login 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems like many people have some issues once they start adding video into
Many people have faced similar issues, and I think I have followed and fixed
I'd like to do some stuffs before main function. I have multiple source files.
I think I have done this before, but it could also be a function
Basically I want to know how many people have tweeted a link to a
This question has been asked before, but I would like a little more detail
I have some legacy DB with many tables (around 100) the old system is
I'm familiar with Core Data basics and have done some dabbling, but have not
I am trying to do something that has been done many times before by
I have seen many people suggesting to use dispatch_once to do the singleton: +(MyClass

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.