개발, 부동산, 의정부, etc
RegExp 개체 본문
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