사용자 도구

사이트 도구


javascript:regexp

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
javascript:regexp [2019/01/25 04:46] – [Password] taekgujavascript:regexp [2025/04/15 10:05] (현재) – 바깥 편집 127.0.0.1
줄 1: 줄 1:
 ===== Javascript RegExp ===== ===== Javascript RegExp =====
 +
 +<code jsvascript>
 +function funRegComma(param){
 +var num = '' +param;
 +var reg = /(^[+-]?\d+)(\d{3})/;
 +while(reg.test(num)){
 +num = num.replace(reg,'$1' + ',' + '$2');
 +}
 +return num;
 +}
 ==== Password ==== ==== Password ====
 비밀번호 체크하기 위한 RegExp 비밀번호 체크하기 위한 RegExp
줄 6: 줄 16:
 </code> </code>
 ^RegEx ^Description^ ^RegEx ^Description^
-|^ |The password string will start this way|+|''^'' |The password string will start this way|
 |(?=.*[a-z]) |The string must contain at least 1 lowercase alphabetical character| |(?=.*[a-z]) |The string must contain at least 1 lowercase alphabetical character|
 |(?=.*[A-Z]) |The string must contain at least 1 uppercase alphabetical character| |(?=.*[A-Z]) |The string must contain at least 1 uppercase alphabetical character|
 |(?=.*[0-9]) |The string must contain at least 1 numeric character| |(?=.*[0-9]) |The string must contain at least 1 numeric character|
-|(?=.[!@#\$%\^&]) |The string must contain at least one special character, but we are escaping reserved RegEx characters to avoid conflict|+|(?=.[!@#\$%\''^''&]) |The string must contain at least one special character, but we are escaping reserved RegEx characters to avoid conflict|
 |(?=.{8,}) |The string must be eight characters or longer| |(?=.{8,}) |The string must be eight characters or longer|
 +| | |
  
 ==== 전화번호 ==== ==== 전화번호 ====
줄 40: 줄 51:
  mySheet1.SetColHidden("detail",false);//type="Html" 보이기.  mySheet1.SetColHidden("detail",false);//type="Html" 보이기.
  </h5:Action>  </h5:Action>
 +==== 숫자의 콤마표현 ====
 +<code javascript>
 +function numberWithCommas(x) {
 +//sumVal = sumVal.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ","); //IE에서 오류
 +    return x.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",");
 +}
 +</code>
 +==== 시분표현 ====
 +<code javascript>
 + //시분포멧 (12:00) 체크
 + var timeFormat = /^([01][0-9]|2[0-3]):([0-5][0-9])$/;
 + //숫자 네자리(0000) 체크
 + var timeFormat2 = /^([01][0-9]|2[0-3])([0-5][0-9])$/;
 +</code>
javascript/regexp.1548391608.txt.gz · 마지막으로 수정됨: 2025/04/15 10:05 (바깥 편집)