Possible Duplicate:
Using a regular expression to validate an email address
I have just made a RE for email address. Its a simplest one and works well. But i want to make it more better. I mean to say that, an email address can have alphanumeric characters, underscores "_", dot "." but it cannot contain hyphen "-", semicolon ";" etc. Below is my RE that i have just made for email address.
<!DOCTYPE html>
<html>
<body>
<script>
str = "assad-ch7@Yahoo.com";
re = /[a-z0-9][@]((yahoo)|(hotmail)|(gmail))[.]((com)|(co.uk))/i;
result = re.test(str);
document.write(result);
</script>
</body>
</html>
Furthermore, is this the right way to make an RE for an email address??