자바스크립트 정규식
페이지 정보
작성자 미친새 작성일 20-02-21 10:17 조회 18,895 댓글 0본문
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
<html>
<head>
<title> New Document </title>
<meta name=\"Generator\" content=\"EditPlus\">
<meta name=\"Author\" content=\"\">
<meta name=\"Keywords\" content=\"\">
<meta name=\"Description\" content=\"\">
<script type=\"text/javascript\">
function pwchk(chkvalok){
//var f = document.pwdchkform;
//alert(f.num_chr_chk.value);
//alert(chkvalok);
//var inputval = f.num_chr_chk.value;
var inputval = chkvalok;
var chk_alp1 = /^[A-Z]$/;
var chk_alp2 = /[a-z]/;
var chk_num = /[0-9]/;
var chk_cnt = /^[a-zA-Z0-9]{8,20}$/;
//var chk_total =/^([0-9a-zA-Z]+){1,2}$/;
//var chk_total =/^(?=.{6,20})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[^ ]).*$/g;
//var chk_total =/^(?=.{6,20})(?=.*[a-zA-Z])(?=.*[0-9]).*$/g;
//var chk_total =/^(?=.{6,20})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[s]).*$/g;
var chk_total =/^(?=.{6,20})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).*$/g;
//var chkval = chk_alp1.test(inputval);
var chkval = chk_total.test(inputval);
alert(chkval);
if(chkval == false){
//alert(chkval);
chk_alp1_ok = \"ok\";
}
}
function pwchk2(ckval){
//alert(ckval);
pwchk(ckval);
}
</script>
</head>
<body>
<form name=\"pwdchkform\" method=\"post\">
<input type=\"text\" name =\"num_chr_chk\">
<input type=\"button\" value=\"체크\" onclick=\"javascript:pwchk2(num_chr_chk.value);\">
</form>
</body>
</html>
<html>
<head>
<title> New Document </title>
<meta name=\"Generator\" content=\"EditPlus\">
<meta name=\"Author\" content=\"\">
<meta name=\"Keywords\" content=\"\">
<meta name=\"Description\" content=\"\">
<script type=\"text/javascript\">
function pwchk(chkvalok){
//var f = document.pwdchkform;
//alert(f.num_chr_chk.value);
//alert(chkvalok);
//var inputval = f.num_chr_chk.value;
var inputval = chkvalok;
var chk_alp1 = /^[A-Z]$/;
var chk_alp2 = /[a-z]/;
var chk_num = /[0-9]/;
var chk_cnt = /^[a-zA-Z0-9]{8,20}$/;
//var chk_total =/^([0-9a-zA-Z]+){1,2}$/;
//var chk_total =/^(?=.{6,20})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[^ ]).*$/g;
//var chk_total =/^(?=.{6,20})(?=.*[a-zA-Z])(?=.*[0-9]).*$/g;
//var chk_total =/^(?=.{6,20})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[s]).*$/g;
var chk_total =/^(?=.{6,20})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).*$/g;
//var chkval = chk_alp1.test(inputval);
var chkval = chk_total.test(inputval);
alert(chkval);
if(chkval == false){
//alert(chkval);
chk_alp1_ok = \"ok\";
}
}
function pwchk2(ckval){
//alert(ckval);
pwchk(ckval);
}
</script>
</head>
<body>
<form name=\"pwdchkform\" method=\"post\">
<input type=\"text\" name =\"num_chr_chk\">
<input type=\"button\" value=\"체크\" onclick=\"javascript:pwchk2(num_chr_chk.value);\">
</form>
</body>
</html>
댓글목록 0
등록된 댓글이 없습니다.