前端之家收集整理的这篇文章主要介绍了
vbs正则表达式 对网址,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Dim re,s,colMatches,match Set re = New RegExp re.Global = True re.Pattern = "http://(\w+[\w-]*\w+\.)*\w+" s = "http://www.kingsley-hughes.com is a valid web address. And so is " s = s & vbCrLf & "http://www.wrox.com. And " s = s & vbCrLf & "http://www.pc.ibm.com - even with 4 levels." Set colMatches = re.Execute(s) For Each match In colMatches Msg
Box "Found valid URL: " & match.Value Next dim re,s set re= new RegExp re.Pattern = "France" s = "The rain in France falls mainly on the plains." msg
Box re.replace(s,"Spain")