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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:06:03+00:00 2026-05-23T15:06:03+00:00

I have this script uses regular expressions to check that a form field contains

  • 0

I have this script uses regular expressions to check that a form field contains a valid email address.Please explain me from declare

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;

Thank you

Source:

<script type="text/javascript">

/***********************************************
* Email Validation script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e){
var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Please enter a valid email address.")
e.select()
}
return returnval
}

</script>

<form>
<input name="myemail" type="text" style="width: 270px"> <input type="submit" onClick="return checkmail(this.form.myemail)" value="Submit" />

</form>
  • 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-05-23T15:06:04+00:00Added an answer on May 23, 2026 at 3:06 pm

    /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

    / = Begin an expression
    ^ = The matched string must begin here, and only begin here
    \w = any word (letters, digits, underscores)
    + = match previous expression at least once, unlimited number of times
    [] = match any character inside the brackets, but only match one
    \+\. = match a literal + or .
    \w = another word
    - = match a literal -
    * = match the previous expression zero or infinite times
    @ = match a literal @ symbol
    () = make everything inside the parentheses a group (and make them referencable)
    [] = another character set
    \w- = match any word or a literal -
    + = another 1 to infinity quantifier
    \. = match another literal .
    * = another 0 to infinity quantifier
    \w+ = match a word at least once
    [\w-]*\. = match a word or a dash at least zero times, followed by a literal .
    () = another group
    [a-z]{2,4} = match lowercase letters at least 2 times but no more than 4 times
    | = “or” (does not match pipe)
    \d+ = match at least 1 digit
    $ = the end of the string
    / = end an expression
    i = test the string in a case i nsensitive manner

    Or you could try this awesome link. You know, whatever.

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

Sidebar

Related Questions

Well basically I have this script that takes a long time to execute and
I have this little script to toggle a contact form when a button is
I have this line in a useful Bash script that I haven't managed to
I have this RewriteRule that works too well :-) RewriteRule ^([^/]*)/$ /script.html?id=$1 [L] The
I have this script: select name,create_date,modify_date from sys.procedures order by modify_date desc I can
I have this Perl script with many defined constants of configuration files. For example:
I have this .bat script which I use to maven package my application. Problem
I have this bit of script to widen a text box on mouseover and
I have this simple php script <?php echo '<pre>'; // Outputs all the result
I have a JavaScript containing a text-input and some placeholders. The script uses a

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.