ASP 正则表达式

memailbody = RegReplace("<rplmsg>(.|\n)*?</rplmsg>",memailbody,"<div align=left>"&Trim(request("content"))&"</div>" )

Function RegReplace2(stPattern,stString,stReplace)
  RegReplace= stString
   Dim regEx, Match, Matches
   Set regEx =New RegExp        
   regEx.Pattern = stPattern       
   regEx.IgnoreCase =True       
   regEx.Global =True       
   Set Matches =regEx.Execute(stString) 
   For Each Match in Matches     
   'response.write "Match.value="&Match.value
   RegReplace=replace(RegReplace,Match.value,stReplace)
   Next
 End Function
 
 Function RegReplace(stPattern,stString,stReplace)
    RegReplace= stString
  Dim regEx, Match, Matches
  Set regEx =New RegExp
  regEx.Pattern = stPattern
  regEx.IgnoreCase =True
  regEx.Global =True
  RegReplace = regEx.Replace(stString,stReplace)
   
 End Function

posted on 2012-11-19 14:02  canny_strive  阅读(112)  评论(0编辑  收藏  举报

导航