function _check_email(email) {
var pattern = /^(.+)@(.+)$/;
var atom = "\[^\\s\\(\\)<>#@,;:!\\\\\\\"\\.\\[\\]\]+";
var word="(" + atom + "|(\"[^\"]*\"))";
var user_pattern = new RegExp("^" + word + "(\\." + word + ")*$");
var ip_pattern = /^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var domain_pattern = new RegExp("^" + atom + "(\\." + atom +")*$");
var arr = email.match(pattern);
if (!arr) return "Email address seems incorrect (check @ and .'s)";
if (!arr[1].match(user_pattern)) return "The username doesn't seem to be valid.";
var ip = arr[2].match(ip_pattern);
if (ip) {
for (var i=1; i<5; i++) if (ip[i] > 255) return "Destination IP address is invalid!";
}
else {
if (!arr[2].match(domain_pattern)) return "The domain name doesn't seem to be valid.";
var domain = arr[2].match(new RegExp(atom,"g"));
if (domain.length<2) return "This address is missing a hostname!";
if (domain[domain.length-1].length<2 || domain[domain.length-1].length>3)
return "The address must end in a three-letter domain, or two letter country.";
}
return false;
}<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
var pattern = /^(.+)@(.+)$/;
var atom = "\[^\\s\\(\\)<>#@,;:!\\\\\\\"\\.\\[\\]\]+";
var word="(" + atom + "|(\"[^\"]*\"))";
var user_pattern = new RegExp("^" + word + "(\\." + word + ")*$");
var ip_pattern = /^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var domain_pattern = new RegExp("^" + atom + "(\\." + atom +")*$");
var arr = email.match(pattern);
if (!arr) return "Email address seems incorrect (check @ and .'s)";
if (!arr[1].match(user_pattern)) return "The username doesn't seem to be valid.";
var ip = arr[2].match(ip_pattern);
if (ip) {
for (var i=1; i<5; i++) if (ip[i] > 255) return "Destination IP address is invalid!";
}
else {
if (!arr[2].match(domain_pattern)) return "The domain name doesn't seem to be valid.";
var domain = arr[2].match(new RegExp(atom,"g"));
if (domain.length<2) return "This address is missing a hostname!";
if (domain[domain.length-1].length<2 || domain[domain.length-1].length>3)
return "The address must end in a three-letter domain, or two letter country.";
}
return false;
}<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6027 | 9년 전 | 319 | ||
| 6026 | 9년 전 | 278 | ||
| 6025 | 9년 전 | 259 | ||
| 6024 | 9년 전 | 417 | ||
| 6023 | 9년 전 | 294 | ||
| 6022 | 9년 전 | 292 | ||
| 6021 | 9년 전 | 287 | ||
| 6020 | 9년 전 | 261 | ||
| 6019 | 9년 전 | 230 | ||
| 6018 | 9년 전 | 212 | ||
| 6017 | 9년 전 | 252 | ||
| 6016 | 9년 전 | 241 | ||
| 6015 | 9년 전 | 202 | ||
| 6014 | 9년 전 | 172 | ||
| 6013 | 9년 전 | 276 | ||
| 6012 | 9년 전 | 217 | ||
| 6011 | 9년 전 | 227 | ||
| 6010 | 9년 전 | 226 | ||
| 6009 | 9년 전 | 319 | ||
| 6008 | 9년 전 | 206 | ||
| 6007 | 9년 전 | 213 | ||
| 6006 | 9년 전 | 268 | ||
| 6005 | 9년 전 | 233 | ||
| 6004 | 9년 전 | 323 | ||
| 6003 | 9년 전 | 283 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기