사용자 도구

사이트 도구


wiki:javascript:javascript_note:js_regexp

차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
wiki:javascript:javascript_note:js_regexp [2021/04/22 17:39]
emblim98
wiki:javascript:javascript_note:js_regexp [2023/01/13 18:44] (현재)
줄 345: 줄 345:
  
 =====Using test()===== =====Using test()=====
-""test()'' 메서드는 %%RegExp%%(정규식) 메서드입니다.\\+''test()'' 메서드는 %%RegExp%%(정규식) 메서드입니다.\\
 \\ \\
 문자열에서 패턴을 검색하고, 결과에 따라 %%true%% 또는 %%false%%를 반환합니다.\\ 문자열에서 패턴을 검색하고, 결과에 따라 %%true%% 또는 %%false%%를 반환합니다.\\
줄 392: 줄 392:
 ====Example==== ====Example====
 <code javascript> <code javascript>
 +  <script> 
 +    let obj = /e/.exec("The best things in life are free!"); 
 +    document.getElementById("demo").innerHTML = "Found " + obj[0] + " in position " + obj.index + " in the text: " + obj.input; 
 +    /* Found e in position 2 in the text: The best things in life are free! */ 
 +  </script>
 </code> </code>
  
/volume1/web/dokuwiki/data/attic/wiki/javascript/javascript_note/js_regexp.1619080784.txt.gz · 마지막으로 수정됨: 2022/03/10 19:52 (바깥 편집)