RegExp - ASP 정규식

dim rtnResult, regEx
Dim Test : Test = "우리나라만세 하하하 내용"

Set regEx = new RegExp
regEx.Pattern = "<[a-z|/]+[^<>]*>"
regEx.IgnoreCase = True
regEx.Global = True

rtnResult = regEx.Replace(Test, "")
Set regEx = Nothing

response.write rtnResult



//----------------------------------------------------------
//---------- 함수명 : stripTag( ByVal str )
//---------- 설 명 : 문자열에 태그를 모두 삭제한 문자열을 돌려준다.
//----------------------------------------------------------


Function stripTag( ByVal Test)

Set regEx = new RegExp
regEx.Pattern = "<[a-z|/]+[^<>]*>"
regEx.IgnoreCase = True
regEx.Global = True

'response.write "정규식 전 "& Test

stripTag = regEx.Replace(Test, "")


'response.write "정규식 후 "& rtnResult


Set regEx = Nothing

End function



//==========================================================


Function Word_check(str,patrn)

Dim regEx, match, matches
Set regEx = new RegExp
regEx.Pattern = patrn '패턴을 설정합니다.
regEx.IgnoreCase = True '대/소문자를 구분하지 않도록 합니다.
regEx.Global = True '전체 문자열을 검색하도록 설정합니다.
Set Matches = regEx.Excute(str)

If 0 < Matches.count Then
Word_check = False
Else
Word_check = True
End If

End Function

pattern0 = "[^가-힣]" '한글만
pattern1 = "[^-0-9]" '숫자만
pattern2 = "[^-a-zA-Z]" '영어만
pattern3 = "[^가-힣a-zA-Z0-9/]" '숫자와 영어 한글만
pattern4 = "<[^>]*>" '태그만
pattern5 = "[^-a-zA-Z0-9/]" '영어 숫자만
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2009/01/29 16:45 2009/01/29 16:45
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/3940

Trackback URL : http://tcbs17.cafe24.com/tc/trackback/3940

« Previous : 1 : ... 2493 : 2494 : 2495 : 2496 : 2497 : 2498 : 2499 : 2500 : 2501 : ... 6391 : Next »

블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2024/05   »
      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 31  
Statistics Graph

Site Stats

Total hits:
186629
Today:
98
Yesterday:
789