how to validate email in node js
var emailRegex = /^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;
function isEmailValid(email) {
if (!email)
return false;
if(email.length>254)
return false;
var valid = emailRegex.test(email);
if(!valid)
return false;
// Further checking of some things regex can't handle
var parts = email.split("@");
if(parts[0].length>64)
return false;
var domainParts = parts[1].split(".");
if(domainParts.some(function(part) { return part.length>63; }))
return false;
return true;
}
Also in JavaScript:
- javascript includes method getting 'hi' and 'high' problem
- in angular click button button hide div and show div
- jquery nearest
- js filter
- remove curly brackets from stringify javascript
- shuffle array javascript
- regex for number and letters
- jquery select by name
- javascript for loop over dictionary
- react manifest.json 404 (not found)
- js create object from array
- Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x
- what is angularjs used for
- mongoose generate objectid
- jquery close bootstrap model
- add style javascript
- find smallest length string in an array js
- javascript get black or white text base on color
- regex optional whitespace characters
- passing json as datasource to jasper report library
- jquery attribute selector
- javascript sort numbers descending
- replacing characters in string javascript
- access text inside a button from js