Repository URL to install this package:
|
Version:
3.10.7-rc0 ▾
|
/**
* Is validating inputs for the MultiEmailSelect component.
* We need to allow domains and sub domains starting with a @ here as well
* @param {String} string
*/
export default function isEmailValidForWhitelist(string) {
const emailRE = new RegExp(
/^(.*)@((\[[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,}))$/
);
return emailRE.test((typeof string === 'string' && string) || '');
}