'Regular Expression'에 해당되는 글 1건

  1. 2010.05.04 [ASP] Regular Expression (정규식)
2010. 5. 4. 11:17

RegExp를 이용하여 문자열 정규식 검사를 할 수 있다.

<%
Dim StringToSearch 
StringToSearch = "http://www.foo.com"

Set RegularExpressionObject = New RegExp

With RegularExpressionObject
    .Pattern = ".com"
    .IgnoreCase = True
    .Global = True
End With

expressionmatch = RegularExpressionObject.Test(StringToSearch)
If expressionmatch Then
    Response.Write RegularExpressionObject.Pattern & " was found in " & StringToSearch
Else
    Response.Write RegularExpressionObject.Pattern & " was not found in " & StringToSearch
End If
%>


RegExp 개체에는 Test 수를 제외한 Execute Replace 함수도 포함하고 있다. 

자세한 자료는 아래 링크를 참고한다.



Posted by CoolDragon