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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5802 | 9년 전 | 287 | ||
| 5801 | 9년 전 | 328 | ||
| 5800 | 9년 전 | 409 | ||
| 5799 | 9년 전 | 248 | ||
| 5798 | 9년 전 | 263 | ||
| 5797 | 9년 전 | 398 | ||
| 5796 |
|
9년 전 | 938 | |
| 5795 | 9년 전 | 331 | ||
| 5794 | 9년 전 | 295 | ||
| 5793 | 9년 전 | 423 | ||
| 5792 | 9년 전 | 301 | ||
| 5791 |
|
9년 전 | 535 | |
| 5790 |
씨에이치넷
|
10년 전 | 1357 | |
| 5789 | 10년 전 | 410 | ||
| 5788 | 10년 전 | 292 | ||
| 5787 | 10년 전 | 295 | ||
| 5786 | 10년 전 | 335 | ||
| 5785 | 10년 전 | 313 | ||
| 5784 | 10년 전 | 258 | ||
| 5783 | 10년 전 | 256 | ||
| 5782 | 10년 전 | 217 | ||
| 5781 | 10년 전 | 270 | ||
| 5780 | 10년 전 | 288 | ||
| 5779 | 10년 전 | 383 | ||
| 5778 | 10년 전 | 287 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기