Speed up development with full-stack environments for every branch.

Learn More

How to validate Email using Pattern in JavaScript [jQuery, validation and html]

Forked from How to use the jQuery $().ready function.

409 Runs 2035 Views 759 Copies

How to validate email using class Pattern in JavaScript to give the right syntax of email '[email protected]'

Saved

Saved

ahmed.ezz 1

ahmed.ezz
published 3 years ago

function isvalidemail(email){	
	var pattern = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
	if(!pattern.test(email)){
			return false;
		}else{
			return true;
		}
}
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).