Notice
Recent Posts
Recent Comments
Link
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags
more
Archives
Today
Total
관리 메뉴

개발, 부동산, 의정부, etc

RegExp 개체 본문

개발/classic asp

RegExp 개체

NaCl대표 2018. 12. 27. 09:24

RegExp 개체

간단한 정규식을 지원합니다.

참고

아래 코드는 RegExp 개체의 사용 예를 보여줍니다.

Function RegExpTest(patrn, strng)
   Dim regEx, Match, Matches   ' 변수를 작성합니다.
   Set regEx = New RegExp   ' 정규식을 작성합니다.
   regEx.Pattern = patrn   ' 패턴을 설정합니다.
   regEx.IgnoreCase = True   ' /소문자 구분 안함을 설정합니다.
   regEx.Global = True   ' 전역을 설정합니다.
   Set Matches = regEx.Execute(strng)   ' 찾기를 실행합니다.
   For Each Match in Matches   ' Matches 컬렉션을 반복합니다.
      RetStr = RetStr & "Match found at position "
      RetStr = RetStr & Match.FirstIndex & ". Match Value is '"
      RetStr = RetStr & Match.Value & "'." & vbCRLF
   Next
   RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))


'개발 > classic asp' 카테고리의 다른 글

Clear 메서드  (0) 2018.12.27
로케일 ID(LCID) 차트  (0) 2018.12.27
Matches 컬렉션  (0) 2018.12.27
Match 개체  (0) 2018.12.27
Err 개체  (0) 2018.12.27
Comments