• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Forms and Regular Expressions > Validating an Email Address with Reg...

Validating an Email Address with Regular Expressions

Back in Chapter 6, one of the tasks was validating an email address. To do the job, the script needed to be relatively long. Script 7.1, at its heart, does exactly the same thing as Script 6.7; but by using regular expressions, it takes many fewer lines and you get a more rigorous result.

Script 7.1. These few lines of JavaScript go a long way to validate email addresses.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint