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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:16:52+00:00 2026-06-02T20:16:52+00:00

//if HTML5 input email input is not supported if(type == ’email’){ if(!Modernizr.inputtypes.email){ var emailRegEx

  • 0
//if HTML5 input email input is not supported
if(type == 'email'){    
    if(!Modernizr.inputtypes.email){ 
         var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@([a-zA-Z0-9\-])+\.+([a-zA-Z0-9]{2,4})+$/;              
         if( !emailRegEx.test(value) ){ 
            this.focus();
            formok = false;
            errors.push(errorMessages.email + nameUC);
            return false;
        }
    }
}

This is my javascript regex for checking if e-mail format is correct. But When I try it myself it shows no error for any ..@.. It does not check .com or whatever in the end. What am I doing wrong?

  • 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-02T20:16:54+00:00Added an answer on June 2, 2026 at 8:16 pm

    You need to use a regex that actually fits for an email address. Your current one is completely broken as there are tons of valid addresses it won’t accept.

    See http://www.regular-expressions.info/email.html for a more detailed description and arguments why a regex is not such a good idea after all.

    Anyway, here’s one that probably fits for your needs:

    [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?
    

    Here’s what regular-expressions.info says about this regex:

    We get a more practical implementation of RFC 2822 if we omit the syntax using double quotes and square brackets. It will still match 99.99% of all email addresses in actual use today.

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

Sidebar

Related Questions

OK, so in HTML5 browsers you can have: <input class=txt-box type=email name=email rel=required />
If the input field's type is email in an html5 form, and if someone
I'm using the jQuery UI Slider as a fallback for the HTML5 input type=range.
In HTML5 there is a new input type, 'search'. On most browser it's just
HTML5 Anyway to include a submit button directly into a input type=text? For instance
I’m trying to make a html5 form that contains one email input, one check
I would like to style form inputs of type email and password, but not
I'd like to use the new <input type="email" /> element. I'd like to have
I am trying to create an HTML5 input date component so that I can
I have an HTML5 Canvas on my page along with two text input fields.

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.