<%
Function RegExpReturn(Str)
Dim RegExp, ResultStr
Set RegExp = New RegExp
RegExp.IgnoreCase = True 'TRUE:대소문자 구분안함, FALSE:대소문자구분
RegExp.Global = True '전체, 첫번째 일치
RegExp.Pattern = "<.+?>" '태그제거
'RegExp.Pattern = "\(.*?\)" '괄호제거
'RegExp.Pattern = "【.+?(】)" '【 】사이의 데이터
'RegExp.Pattern = "\(.+?(\))" '( ) 사이의 데이터
'RegExp.Pattern = "[^가-힣]" '한글만
'RegExp.Pattern = "[^-0-9 ]" '숫자만
'RegExp.Pattern = "[^-a-zA-Z]" '영어만
'RegExp.Pattern = "[^-가-힣a-zA-Z0-9/ ]" '숫자와 영어 한글만
'RegExp.Pattern = "<[^>]*>" '태그만
'RegExp.Pattern = "[^-a-zA-Z0-9/ ]" '영어 숫자만
ResultStr = RegExp.REPLACE(Str, "")
'strOutput = objRegExp.Test(strHTML) 'BOOLEAN 반환
RegExpReturn = ResultStr
Set RegExp = Nothing
End Function
' 배열로 처리시
Set sRegExp = NEW RegExp
sRegExp.IgnoreCase = True 'TRUE:대소문자 구분안함, FALSE:대소문자구분
sRegExp.Global = True '전체, 첫번째 일치
sRegExp.Pattern = "<img.+?>"
Set Match = sRegExp.Execute(Contents)
For Each arMatch In Match 'Match컬렉션 루프
arImage(0) = arMatch.Value '추출된 이미지태그
sRegExp.Pattern = "/data/.+"""
Set Match = sRegExp.Execute(arImage(0))
arImage(0) = Replace(Replace(Match(0), "/data/", ""), """", "")
arImage(0) = Replace(Replace(Match(0), "/data/", ""), """", "")
Exit For
Next
%>
'classic asp' 카테고리의 다른 글
[classic asp] json 요청하고 응답받기 (mime) (0) | 2019.03.04 |
---|---|
[classic asp] Stream 이용한 파일 읽어오기 (0) | 2019.02.26 |
[classic asp] 파일/폴더관리 (0) | 2019.02.13 |
[classic asp] 웹페이지 태그 소스가져오기 (0) | 2019.02.13 |
[classic asp] SMTP 이용한 이메일발송 (0) | 2019.02.13 |