帳號,密碼,郵箱和移動手機號碼正則:
acc_regex: /^[a-zA-Z0-9_-]{4,16}$/, pwd_regex: /^.*(?=.{6,})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$/, email_regex: /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/, mobile_regex: /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[0,5-9])|(18[0,5-9]))\d{8}$/,
account_change: function (e) { const self = e.target.value if (self != '') { this.isAccRegexValid(self); } else { //驗證失敗 } }, isAccRegexValid: function (inputValue) { if (this.acc_regex.test(inputValue)) { //正則驗證成功 } else { //正則驗證失敗 } },