JavaScript email validation

var emailreg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,10})$/;

if( emailreg.test( 'value_to_test_against' ) == false ) {
   //Email invalid
}