igi_orion_cignacmb
Version:
Censors words out of text
31 lines (30 loc) • 816 B
JavaScript
/*
* @Author: weicong.ling
* @Date: 2020-05-06 10:03:29
* @Last Modified by: weicong.ling
* @Last Modified time: 2020-05-11 14:21:36
*/
/**
*
* @param {手机号码} result
*/
var email = function (result) {
var value = result.field.value;
var error = {
isCorrect: true,
type: "modal",
msg: "请输入正确的" + result.name,
code: "",
id: result.id
};
try {
var patt1 = new RegExp("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9_\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");//验证邮件
if (!patt1.test(value)) {
error.isCorrect = false;
}
} catch (error) {
console.error(error);
}
return error;
};
module.exports = email;